-
Exception Handling
What is the output of the following program, When tested under JDK 5.0class ExceptionDemo{ public static void main(String[] args) { int a[] = new int[] {1,2,3,4,5}; try{ System.out.prinltln(a[6]); } catch(Exception e) { System.out.println("Catching Exception ..."); } catch(ArrayIndexOutofBoundsException ae) { System.out.println("Catching ArrayIndexOutOfBounds...
-
What is the Output of the following Java Program
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);}}
-
Output of Java Program
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
-
Implement Interface using Polymorphism
How an interface can be implemented using polymorphism?Why multiple inheritence is not used in Java?
-
Illegal State of Exception
When does thread throws illegal state of exception?Explain with two scenarios?
-
Nullpointer Exception
What is Nullpointer Exception How it will be reduced