Core Java - Interview Questions and Answers


  1. Is null a keyword?
    The null value is not a keyword.
  2. Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
    The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.
  3. Is the ternary operator written x : y ? z or x ? y : z ?
    It is written x ? y : z.
  4. How is rounding performed under integer division?
    The fractional part of the result is truncated. This is known as rounding toward zero.
  5. If a class is declared without any access modifiers, where may the class be accessed?
    A class that is declared without any access modifiers is said to have package access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.
  6. Does a class inherit the constructors of its superclass?
    A class does not inherit constructors from any of its superclasses.

« Prev   [ Page 15 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 |