日期:2014-05-20 浏览次数:20716 次
package helloworldapp;
public class first
{
class J_Employee
{
public int m_workYear;
public J_Employee()
{
m_workYear = 1;
}
}
public class J_Teacher extends J_Employee
{
public int m_classHour;
public J_Teacher()
{
m_classHour = 96;
}
public void mb_printInfo()
{
System.out.println("该教师的工作年限为"+m_workYear);
System.out.println("该教师的授课课时为"+m_classHour);
}
public static void main(String args[])
{
J_Teacher tom = new J_Teacher();
tom.mb_printInfo();
}
}
}
public static void main(String args[])
{
PolymorphismTest pltt=new PolymorphismTest();
PolymorphismTest.J_Teacher tom=pltt.new J_Teacher();
tom.mb_printInfo();
}