Core Java Interview Question, Interview Question

This page discusses - Core Java Interview Question, Interview Question

Core Java Interview Question, Interview Question

Core Java Interview Question Page 20

     

Question: Name four Container classes.

Answer: Window, Frame, Dialog, File Dialog, Panel, Applet, or ScrollPane

Question: What is the difference between a Choice and a List?

Answer: A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice. A List may be displayed in such a way that several List items are visible. A List supports the selection of one or more List items.

Question: What class of exceptions are generated by the Java run-time system?

Answer: The Java runtime system generates Runtime Exception and Error exceptions.

Question: What class allows you to read objects directly from a stream?

Answer: The ObjectInputStream class supports the reading of objects from input streams.

Question: What is the difference between a field variable and a local variable?

Answer: A field variable is a variable that is declared as a member of a class. A local variable is a variable that is declared local to a method.

Question: Under what conditions is an object's finalize() method invoked by the garbage collector?

Answer: The garbage collector invokes an object's finalize() method when it detects that the object has become unreachable.

Question: How are this() and super() used with constructors?

Answer: this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.

Question: What is the relationship between a method's throws clause and the exceptions that can be thrown during the method's execution?

Answer: A method's throws clause must declare any checked exceptions that are not caught within the body of the method.

Question: What is the difference between the JDK 1.02 event model and the event-delegation model introduced with JDK 1.1?

Answer: The JDK 1.02 event model uses an event inheritance or bubbling approach. In this model, components are required to handle their own events. If they do not handle a particular event, the event is inherited by (or bubbled up to) the component's container. The container then either handles the event or it is bubbled up to its container and so on, until the highest-level container has been tried.

In the event-delegation model, specific objects are designated as event handlers for GUI components. These objects implement event-listener interfaces. The event-delegation model is more efficient than the event-inheritance model because it eliminates the processing required to support the bubbling of unhand led events.

Question: How is it possible for two String objects with identical values not to be equal under the == operator?

Answer: The == operator compares two objects to determine if they are the same object in memory. It is possible for two String objects to have the same value, but located indifferent areas of memory.

Question: Why are the methods of the Math class static?

Answer: So they can be invoked as if they are a mathematical code library.

Question: What Checkbox method allows you to tell if a Checkbox is checked?

Answer: getState()

Question: What state is a thread in when it is executing?

Answer: An executing thread is in the running state.

Question: What are the legal operands of the instance of operator?

Answer: The left operand is an object reference or null value and the right operand is a class, interface, or array type.

Tutorials

  1. Core Java Interview Question Page 1
  2. Core Java Interview Question Page 3
  3. Core Java Interview Question Page 8
  4. Core Java Interview Question, Interview Question
  5. Core Java Interview Question, Interview Question
  6. Core Java Interview Question, Interview Question
  7. Core Java Interview Question, Interview Question
  8. Core Java Interview Question, Interview Question
  9. Core Java Interview Question, Interview Question
  10. Core Java Interview questions and answers
  11. Core Java Interview Question, Interview Question
  12. Core Java Interview Question, Interview Question
  13. Core Java Interview Question, Interview Question
  14. Core Java Interview Question, Interview Question
  15. Core Java Interview Question, Interview Question
  16. Core Java Interview Question, Interview Question
  17. Core Java Interview Question, Interview Question
  18. Core Java Interview Question, Interview Question
  19. Core Java Interview Question, Interview Question
  20. Core Java Interview Question, Interview Question
  21. Core Java Interview Question, Interview Question
  22. Core Java Interview Question, Interview Question
  23. Core Java Interview Question, Interview Question
  24. Core Java Interview Question, Interview Question
  25. Core Java Interview Question, Interview Question
  26. Core Java Interview Question, Interview Question
  27. Core Java Interview Question, Interview Question
  28. Core Java Interview Question, Interview Question
  29. Core Java Interview Question, Interview Question
  30. Core Java Interview Question, Interview Question
  31. Core Java Interview Question, Interview Question
  32. Core Java Interview Question, Interview Question
  33. Core Java Interview Question, Interview Question
  34. Core Java Interview Question, Interview Question
  35. Core java Interview Questions