Advanced Java - Interview Questions and Answers


  1. What are wrapped classes?
    Wrapped classes are classes that allow primitive types to be accessed as objects.
  2. Does garbage collection guarantee that a program will not run out of memory?
    Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.
  3. What restrictions are placed on the location of a package statement within a source code file?
    A package statement must appear as the first line in a source code file (excluding blank lines and comments).
  4. Can an object's finalize() method be invoked while it is reachable?
    An object's finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object's finalize() method may be invoked by other objects.
  5. What is the immediate superclass of the Applet class?
    Panel.
  6. What is the difference between preemptive scheduling and time slicing?

    Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks.

    The scheduler then determines which task should execute next, based on priority and other factors.


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