public interface I1{Static String x="inside I1";public void someMethod();}class A implements I1{ public static void main(String args[[]){ System.out.println("Calling I1 var ..."+I1.x);}}
Latest Answer: public int x = 1; int x = 1; static int x = 1; public final int x = 1; public public static int x = 1; public final int x = 1; static final int x = 1 public static final int x = 1; Above combinations all are legal & same.ANDall declerations(var) ...
What is the output of the following program?class A{ public static void main(String[] s) { System.out.println(s[1] + s[2] + s[3]);}}java A 12345Options(i) 1(ii) 12(iii)1234(iv)234(v) Compilation Error
Latest Answer: (v) Compilation Error ...
Which Underlying Collection will provide the remove() method?
Latest Answer: Collection is an interface, and whatever class implements the interface must implement the remove() method.This question is not a complete sentence and that makes it kind of difficult to understand the intent and then answer it appropriately. ...
How an interface can be implemented using polymorphism?Why multiple inheritence is not used in Java?
Latest Answer: interface I1{ void disp();}class MyClass implents I1{ void disp("JAI SREE RAM");}public class TestPoly{ public static void main(String args[]) ...
When does thread throws illegal state of exception?Explain with two scenarios?
Latest Answer: Any attempt to change the status after the thread has been started, throws an IllegalThreadstateException.Scenerio 1If a thread has already started and you try to call method setDaemon(boolean) on threadt.setDaemon(true);Scenerio 2If you call start() ...
int i=10;i=i++;System.out.println(i);
Latest Answer: eleven is the correct answer i=i++;the above statement is equivalent to i=i; //here ...
How can we restrict a class so that no instance creation of class possible without declaring the class as Abstract ?
Latest Answer: yes by making the constructor of a class private we can achieve this. Since the private modifier is accessible withing the class, when a class outside this class tries to instantiate this class it gives error as the class cannot be instantiated. ...
How can i convert a string object to a primitive Integer type???????Thanks
Latest Answer: if u try to convert "hello" to int u will get NumberFormatException ...
the Color class contains some color names as constant variables . but it is twice. what for it.it have two variables like RED and red. what for it. i know that one is for set and get Color.but how the
Latest Answer: Yes. It is using for IGNORING case. ...
Latest Answer: SQLexception that is thrown when SQL Server returns a warning or error. This class cannot be inherited. SQLException comes under Runtime exception because errors comes under Unchecked Exceptions. ...
View page << Previous 1 2 [3] 4 5 6 7 8 9 10 Next >>

Go Top