Core Java - Interview Questions and Answers


  1. Which class is extended by all other classes?
    The Object class is extended by all other classes.
  2. Which non-Unicode letter characters may be used as the first character of an identifier?
    The non-Unicode letter characters $ and _ may appear as the first character of an identifier
  3. What restrictions are placed on method overloading?
    Two methods may not have the same name and argument list but different return types.
  4. What is casting?
    There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.
  5. What is the return type of a program's main() method?
    void.
  6. If a variable is declared as private, where may the variable be accessed?
    A private variable may only be accessed within the class in which it is declared.

« Prev   [ Page 12 of 22  Jump... Next »

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