日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

java员工编号程序_用JAVA编写一个employee类 为员工自动产生员工号

發布時間:2023/12/1 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java员工编号程序_用JAVA编写一个employee类 为员工自动产生员工号 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

差不多就是這個感覺..

class Employee {

/**

* @param args

*/

private int number;

private String name;

private String birthday;

static int IDnumber=0;

public Employee(String name,String birthday){

IDnumber++;

this.setNumber(IDnumber);

this.setName(name);

this.setBirthday(birthday);

}

public void setNumber(int number){

this.number=number;

}

public int getNumber(){

return number;

}

public void setName(String name){

this.name=name;

}

public String getName(){

return name;

}

public void setBirthday(String birthday){

this.birthday=birthday;

}

public String getBirthday(){

return birthday;

}

public static void main(String[] args)

{

// TODO Auto-generated method stub

String str1="姓名";

String str2="生日";

Employee e[]=new Employee[10];

for(int i=0;i

{

e[i]=new Employee(str1+i,str2+i);

System.out.println("第"+i+"個員工的姓名是"+e[i].getName());

System.out.println("第"+i+"個員工的生日是"+e[i].getBirthday());

System.out.println("第"+i+"個員工的員工號是"+e[i].getNumber());

}

}

}

總結

以上是生活随笔為你收集整理的java员工编号程序_用JAVA编写一个employee类 为员工自动产生员工号的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。