Java Basics - Interview Questions and Answers


  1. Difference between Swing and Awt?
    AWT are heavy-weight componenets. Swings are light-weight components. Hence swing works faster than AWT.
  2. What will be the default values of all the elements of an array defined as an instance variable?

    If the array is an array of primitive types, then all the elements of the array will be initialized to the default value corresponding to that primitive type.

    Example: All the elements of an array of int will be initialized to 0(zero), while that of boolean type will be initialized to false. Whereas if the array is an array of references (of any type), all the elements will be initialized to null.


« Prev   [ Page 17 of 17  Jump...

Jump to page : 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |