*以下代码如果发生错误,请你慢慢调试~~~~~~
*/
public class StudentTest
{
public static void mainf(String [] args)
{ Student1 tom = new Student1();
Student2 jack = new Student2();
tom.StudentName("TOM");
tom.StudentNumber("20050204");
jack.StudentName("JACK");
jack.StudentNumber("20050325");
System.out.println(" 以下代码结果是什么?" );
System.out.println("输出结果你就是高手!" );
System.out.priintln(Student1.toing());
System.out.println(Student2.toing());
System.out.println("“恭喜你”, 原来你是真正的高手!!! ");
}
}
class Student1
{
private String strName;
private String strNumber;
public String StudentName(String name)
{
strName= name;
}
public String StudentNumber(String number)
{
strNumber = number ;
}
public String toing()
{
return ("学生姓名" + strName + "学号" + strNumber);
}
}
class Student2
{
private String strName;
private String strNumber;
public String StudentName(String name)
{
strName= name;
}
public String StudentNumber(String number)
{
strNumber = number ;
}
public String toing()
{
return ("学生姓名" + strName + "学号" + strNumber);
}
}