abstractclassPerson{privateString name =null;privateString major =null;publicvoidsetName(String name){this.name = name;}publicStringgetName(){returnthis.name;}publicabstractStringgetDecription();}classStudentextendsPerson{publicStringgetDecription(){return"this is student";}}classEmplyeeextendsPerson{publicStringgetDecription(){return"this is emplyee";}}publicclassApp{publicstaticvoidmain(String[] args){Student student =newStudent();
student.setName("tangxin");System.out.println(student.getName());System.out.println(student.getDecription());Emplyee emplyee =newEmplyee();
emplyee.setName("zhanggang");System.out.println(emplyee.getName());System.out.println(emplyee.getDecription());Person person =newStudent();}}