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: It will throw array index out of bounds exception which is not in options. ...
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: I think your question is how to achieve Runtime Polymorphism using using interface.then the answer is :interface MyInf{ void show();}class A implements MyInf{ ...
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: The answer is 10. What is distressing is the lack of understanding that some have as to why this is so. The value of 'i' is incremented, but the value that is returned by post increment is the original value. Since assignment is right associated, the ...
How can we restrict a class so that no instance creation of class possible without declaring the class as Abstract ?
Latest Answer: Only abstract classes can not be instantiated. If you make the constructor private then you can not instantiate it outside of the class but you can still instantiate it within the same class. ...
How can i convert a string object to a primitive Integer type???????Thanks
Latest Answer: class StringConver{ public static void main(String[] s) { //String s1 = "Hello"; If you try this you will get NumberFormatException String s1 = "12345"; ...
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. ...
Latest Answer: Local variable cannot be modified using any of the acceess specifiers means you can not write private or protected or public before them.Local variables are by default (implicitly)Â private no need to make it explicitly private or protected or public ...
View page << Previous 1 2 3 [4] 5 6 7 8 9 10 Next >>

Go Top