What is singleton class example?


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Core Java Interview Questions

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 is difference between perfom() & excute() ?

2 Answers   IBM,


What are the main differences between the java platform and other platforms?

0 Answers  


what is the diffrence between class and object?

5 Answers  


What is token in java?

0 Answers  






public class Garbage { int a=0; public void add() { int c=10+20; System.out.println(c); System.out.println(a); } public static void main(String args[]) { Garbage obj=new Garbage(); System.gc(); System.out.println("Garbage Collected"); obj.add(); } } Above is a code in java used for garbage collection. object obj has been created for the class Garbage and system.gc method is called. Then using that object add method is called.System.gc method if called the obj should be garbage collected?

6 Answers  


Why java is said to be pass-by-value ?

0 Answers  


describe synchronization in respect to multithreading? : Java thread

0 Answers  


What are the differences between heap and stack memory?

0 Answers  


What is a locale?

0 Answers   Aspire, Infogain,


Can i have abstract class with no abstract methods?

22 Answers   CTS,


how to handle http request in struts

2 Answers   Polaris,


Categories