Integer.parse Int(bf.readLine(System.out.println("enter value for n["+m+"]:"))); can it run under this
1 3140interface 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 5866
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?
Why java is platform independent? Explain.
In a container there are 5 components. I want to display the all the components names, how will you do that one?
What is overriding in java?
Explain about fail safe iterators in java?
How much is a java license?
Define inheritance with reference to java.
Can we have a method name same as class name in java?
What is the difference between a constructor and a method?
What is method overloading in JAVA? Why is it not present in C ?
What is the tradeoff between using an unordered array versus an ordered array?
How to instantiate static nested classes in java?
Is null keyword in java?
What is an example of declaration?
What is bifunction in java?