Where is java located?
Hi Friends, I am new to java. Can u explain about thread concept.How i know one thread is locked, and how can i force or acquire another thread for lock . Finally how to know thread is released from lock. Explain types of lock(like method level and block level) in thread.
Why is inheritance used in java?
Why do we use public static with the main function in Java?
13 Answers College School Exams Tests, Infosys,
Can a singleton class be inherited?
Suppose there is an array list [10,5,20,19,15,24].Print them in ascending & descending order in collection framework concept ???
Why do I need to declare the type of a variable in java?
How we can generate random numbers in java?
What is set in java?
what are synchronized methods and synchronized statements? : Java thread
What is consumer interface?
What is the size of a string in java?
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.