import java.util.*;
public class employeetest {
class employee{
private String name;
private double salary;
private Date hireday;
public employee(String n,double s,int year,int month,int day){
name = n;
salary = s;
GregorianCalendar calendar=
new GregorianCalendar(year,month-1,day);
hireday=calendar.getTime() ;
}
public String getname(){
return name;
}
public double getsalary(){
return salary;
}
public Date gethireday(){
return hireday;
}
public void raisesalary(double bypercent){
double raise=salary*bypercent/100;
salary+=raise;
}
}
public static void main(String args[]){
employee staff[]=new employee[3];
staff[0] = new employee("张三",75000,1987,12,15);
staff[1] = new employee("李四",50000,1989,10,1) ;
staff[2] = new employee("王五",40000,1990,3,15) ;
for(int i=0;i
for(int i=0;i
System.out.println("姓名="+e.getname()+",工资="+e.getsalary()+",工作日期="+e.gethireday() );
}}}
package untitled3;
class zuobiao{
private float x;
private float y;
public zuobiao(float a,float b){
x=a;
y=b;
}
public float getx(){
return x;
}
public float gety(){
return y;
}
public static void main(String args[]){
zuobiao point[]=new zuobiao[4];
point[0] = new zuobiao(1,2);
point[1] = new zuobiao(1,3);
point[2] = new zuobiao(2,1);
point[3] = new zuobiao(3,2);
for (int i=0;i<4;i++){
zuobiao e=point[i];
System.out.println("x:"+e.getx()+"y:"+e.gety());
}
}}这个程序跟那个类似。.但这个就是对的
题目是课本上的程序.课本上好几个程序都是这样写的。但我打进到JBUILDER就会错.谁能详细的说说