extending thread class or implementing runnable interface. Which is better? : Java thread


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

Post New Answer

More Core Java Interview Questions

Real Time sample code for Encapsulation and Abstraction. where to use abstract and where to use specifies like public private.

2 Answers  


What is the use of optional ?

0 Answers  


What is a generic type?

0 Answers  


what is request dispatcher and how does it work?

2 Answers   CTS,


What is the use of beaninfo?

0 Answers  


What is one third plus one third as a fraction?

0 Answers  


How a string is stored in memory?

0 Answers  


What is the difference between == and === javascript?

0 Answers  


What does void * mean?

0 Answers  


What is the difference between choice and list?

0 Answers  


what is use of session tracking ?with example?

1 Answers   Photon,


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  


Categories