Advanced Java - Interview Questions and Answers


  1. What invokes a thread's run() method?
    After a thread is started, via its start() method or that of the Thread class, the JVM invokes the thread's run() method when the thread is initially executed.
  2. What is the difference between the Boolean & operator and the && operator?

    If an expression involving the Boolean & operator is evaluated, both operands are evaluated. Then the & operator is applied to the operand. When an expression involving the && operator is evaluated, the first operand is evaluated.

    If the first operand returns a value of true then the second operand is evaluated. The && operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped.

  3. Name three subclasses of the Component class.
    Box.Filler, Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar, or TextComponent.
  4. What is the GregorianCalendar class?
    The GregorianCalendar class provides support for traditional Western calendars.
  5. Which Container method is used to cause a container to be laid out and redisplayed?
    validate() method is used to cause a container to be laid out and redisplayed.
  6. What is the purpose of the Runtime class?
    The purpose of the Runtime class is to provide access to the Java runtime system.

« Prev   [ Page 9 of 31  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 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |