Object Oriented Programming (OOPs)

© examsiri.com
Question : 43 of 72
 
Marks: +1, -0
1. class Person{
2.  String name ="No name";
3.  public Person(String nm) {name =nm;}
4. }
5. class Employee extends Person{
6.  String empID = "0000";
7.  public Employee(String id) { empID=
8. }
9. }
10. public class EmployeeTest{
11.  public static void main(String [] args){
12.    Employee e= new Employee("4321");
13.   System.out.println(e.empID);
14.  }
15. }
Go to Question: