黑马程序员技术交流社区
标题:
首次独立打出这么多代码,心里还有点小激动呢
[打印本页]
作者:
madongdong
时间:
2015-12-21 22:07
标题:
首次独立打出这么多代码,心里还有点小激动呢
class Test_Employee {
public static void main(String[] args) {
Employee e = new Employee();
e.setName("张三");
e.setId("i9979");
e.setSalry(15992);
e.worke();
}
}
class Employee {
private double salry;
private String name;
private String id;
public Employee(){}
public Employee(String name,String id, double salry){
this.name = name;
this.id = id;
this.salry = salry;
}
public void setName(String name){
this.name = name;
}
public String getName(){
return name;
}
public void setId(String id){
this.id = id;
}
public String getId(){
return id;
}
public void setSalry(double salry){
this.salry = salry;
}
public double getSalry(){
return salry;
}
public void worke(){
System.out.println("我叫"+name+"我的ID是"+id+",我的薪酬是"+salry);
}
}
作者:
狮子王
时间:
2015-12-22 20:56
哈哈哈 路还长 加油 !!!
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2