/*
以StudentTest.java保存,因为StudentTest有public static void main()方法。
主要是一些拼写的错误,程序没问题。
*/
/**
*这个程序主要用来测试类名与文件名的一致性的问题
*/
class StudentTest
{
public static void main(String[] args)
{
//Student aStudent = mew Student();
Student aStudent = new Student();
aStudent.setName("张楠");
aStudent.setStudentNum("20030408");
//System.out.println("学生的姓名是:" +aStudent.getName() ",学号是:" + aStudent.detStudentNum() );
System.out.println("学生的姓名是:" +aStudent.getName() +",学号是:" + aStudent.getStudentNum() );
}
}
class People
{
private String name;
public String getName()
{
return name;
}
public void setName(String strName)
{
name = strName;
}
}
class Student extends People
{
private String studentNum;
public String getStudentNum()
{
return studentNum;
}
//public void setStudevtNum(string strStudentNum)
public void setStudentNum(String strStudentNum)
{
studentNum = strStudentNum;
}
}
class Test
{
public static void main(String[] args)
{
Student aStudent = new Student();
aStudent.setName("张楠");
aStudent.setStudevtNum("20030408");
System.out.println("学生的姓名是:" +aStudent.getName()+ ",学号是:" + aStudent.getStudentNum() );
}
}
class People
{
private String name;
public String getName()
{
return name;
}
public void setName(String strName)
{
name = strName;
}
}
class Student extends People
{
private String studentNum;
public String getStudentNum()
{
return studentNum;
}
public void setStudevtNum(String strStudentNum)
{
studentNum = strStudentNum;
}
}