Answered Questions

  • 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...

    kuchipudi Prasad

    • May 31st, 2012

    Output is "catching exception"

  • What is the difference between Static and final?

    Jitendra singh

    • Sep 23rd, 2015

    Actually main reason that new make a class create only print my name not use object. You can create a simple program without using object this reason Java not 100% object oriented language {geshibot l...

    SHWETHA g

    • Aug 31st, 2015

    "Static" keyword is used to a variable/method where a value of that variable has to be common to all objects created for example: bank interest rate for farmers loan common to all farmers.
    where as "final" is to make a method or variable that should not be modified once after implementing.

  • Why we can not override static method?

    Ramesh

    • Feb 4th, 2016

    If a subclass defines a class method with the same signature as a class method in the superclass, the method in the subclass hides the one in the superclass. You didn't override the method a(), because static methods are not inherited. If you had put @Override, you would have seen an error.

  • Difference between == and equals()