what is meant by Garbage collection?
No Answer is Posted For this Question
Be the First to Post Answer
all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.
What does method mean?
What is a loop java?
What is navigable map in java?
What are the restrictions imposed by a Security Manager on Applets?.
Which package is imported by default?
What is an interface in java? Explain
When is an object subject to garbage collection?
What is ‘is-a ‘ relationship in java?
interface X{ void m1(); void m2(); } class Child2 extends Object implements X { public void m1(){ System.out.println("Child2 M1"); } public void m2(){ System.out.println("Child2 M2"); } } public class ParentChildInfterfaceDemo { public static void main(String[] args){ X x = new Child2(); X x1 = new Child2(); x.m1(); x.m2(); x.equals(x1); } } Will the above code work? If yes? Can you please explain why the code x.equals(x1) will work as the equals method is called on interface reference vaiable?
Differentiate between the constructors and methods in java?
What is the main purpose of java?