Integer.parse Int(bf.readLine(System.out.println("enter value for n["+m+"]:"))); can it run under this
1 2297interface 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?
2 4814
Why do we use return statement?
Explain the use of javap tool.
List down the methods and interfaces of collection class in java.
How do you know if a value is nan?
Give a practical example of singleton class usage?
What is difference between wait and notify in java?
Is it possible to override the main method?
What is the access scope of a protected method?
What does system.gc() and runtime.gc() methods do?
Is java platform independent?
How do you implement polymorphism in our day to day life?
State the main difference between c++ and java?
What is static synchronization?
Which class should you use to obtain design information about an object in java programming?
How do you reverse sort a list in java?