How does compareto method work?
No Answer is Posted For this Question
Be the First to Post Answer
What do you understand by java?
transaction attributes ?
What is type parameter in java?
What is multi-catch block in java?
What is the difference between pass by reference and pass by pointer?
How to use scanner in java?
What are disadvantages of java?
Name the package that always imported by default?
What is Transient and volatile
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?
What is the primitive type short?
What is java command?