How will you create the class for the following scenario?
Employees under one employee?
Answers were Sorted based on User's Feedback
Answer / jagdish
class Employee {
Integer empCode;
String firstName;
String lastName;
List<Employee> subEmployees;
}
Is This Answer Correct ? | 4 Yes | 1 No |
what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread
What is meant by object oriented programming – oop?
Difference between Linked list and Queue?
What is the default value of byte datatype in java?
JVM is platform independent or depeneded?
What environment variables are required to be set on a machine in order to run Java programs?
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?
Which is better 64 bit or 32 bit?
What are the OOAD concepts in java explain with examples?
What is UNICODE?
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.
What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?