当前位置: 技术问答>java相关
这段代码到底那里错了!???为什么一直通不过啊!55555
来源: 互联网 发布时间:2015-07-09
本文导语: public class employee { String employeeName; String employeeAddress; public Employee() { employeeName="carol"; employeeAddress="21 pock st."; } public void displayDetails() { system.out.printin("Name of an employee is"+employeeName); system.out.printin("Add...
public class employee
{
String employeeName;
String employeeAddress;
public Employee()
{
employeeName="carol";
employeeAddress="21 pock st.";
}
public void displayDetails()
{
system.out.printin("Name of an employee is"+employeeName);
system.out.printin("Address of an employee is"+
employeeAddress);
}
public static void main(String args[])
{
employee employeeOBJect=new employee();
employeeObject.displayDetails();
}
}
{
String employeeName;
String employeeAddress;
public Employee()
{
employeeName="carol";
employeeAddress="21 pock st.";
}
public void displayDetails()
{
system.out.printin("Name of an employee is"+employeeName);
system.out.printin("Address of an employee is"+
employeeAddress);
}
public static void main(String args[])
{
employee employeeOBJect=new employee();
employeeObject.displayDetails();
}
}
|
public class employee
{
String employeeName;
String employeeAddress;
public employee()
{
employeeName="carol";
employeeAddress="21 pock st.";
}
public void displayDetails()
{
System.out.println("Name of an employee is: "+employeeName);
System.out.println("Address of an employee is: "+employeeAddress);
}
public static void main(String args[])
{
employee employeeOBJect=new employee();
employeeOBJect.displayDetails();
}
}
{
String employeeName;
String employeeAddress;
public employee()
{
employeeName="carol";
employeeAddress="21 pock st.";
}
public void displayDetails()
{
System.out.println("Name of an employee is: "+employeeName);
System.out.println("Address of an employee is: "+employeeAddress);
}
public static void main(String args[])
{
employee employeeOBJect=new employee();
employeeOBJect.displayDetails();
}
}
|
class employee
//change employee to Employee
{
String employeeName;
String employeeAddress;
public employee()
{
employeeName="carol";
employeeAddress="21 pock st.";
}
public void displayDetails()
{
System.out.println("Name of an employee is"+employeeName);
System.out.println("Address of an employee is"+
employeeAddress);
}
public static void main(String args[])
{
employee employeeObJect=new employee();
employeeObJect.displayDetails();
}
}
//change employee to Employee
{
String employeeName;
String employeeAddress;
public employee()
{
employeeName="carol";
employeeAddress="21 pock st.";
}
public void displayDetails()
{
System.out.println("Name of an employee is"+employeeName);
System.out.println("Address of an employee is"+
employeeAddress);
}
public static void main(String args[])
{
employee employeeObJect=new employee();
employeeObJect.displayDetails();
}
}
|
老兄你这有数不清的错误,大小写和关键字。
public class employee
{
String employeeName;
String employeeAddress;
public employee() //
public class employee
{
String employeeName;
String employeeAddress;
public employee() //