How will you create the class for the following scenario?

Employees under one employee?

Answers were Sorted based on User's Feedback



How will you create the class for the following scenario? Employees under one employee? ..

Answer / satya

Employee class

SubEmployee extends Employee

Is This Answer Correct ?    6 Yes 1 No

How will you create the class for the following scenario? Employees under one employee? ..

Answer / jagdish

class Employee {
Integer empCode;
String firstName;
String lastName;
List<Employee> subEmployees;
}

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More Core Java Interview Questions

what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread

0 Answers  


What is meant by object oriented programming – oop?

0 Answers  


Difference between Linked list and Queue?

0 Answers   Virtusa,


What is the default value of byte datatype in java?

0 Answers  


JVM is platform independent or depeneded?

7 Answers  






What environment variables are required to be set on a machine in order to run Java programs?

0 Answers   Tech Mahindra,


I have a Arraylist object, it has duplecate values also. Now question is i want delete duplecate data in that objet with out using Set?

8 Answers   Aricent,


Which is better 64 bit or 32 bit?

0 Answers  


What are the OOAD concepts in java explain with examples?

4 Answers   Aricent, CTS,


What is UNICODE?

3 Answers  


Given: 10. interface A { void x(); } 11. class B implements A { public void x() { } public voidy() { } } 12. class C extends B { public void x() {} } And: 20. java.util.List list = new java.util.ArrayList(); 21. list.add(new B()); 22. list.add(new C()); 23. for (A a:list) { 24. a.x(); 25. a.y();; 26. } What is the result? 1 Compilation fails because of an error in line 25. 2 The code runs with no output. 3 An exception is thrown at runtime. 4 Compilation fails because of an error in line 20.

3 Answers  


What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?

0 Answers  


Categories