199.
Question: Does garbage collection guarantee that a program will not run out of memory?
200. Question: What restrictions are placed on the location of a package statement within a source code file?
201. Question: Can an object's finalize() method be invoked while it is reachable?
202. Question: What is the immediate superclass of the Applet class?
203. Question: What is the difference between preemptive scheduling and time slicing?
204. Question: Name three Component subclasses that support painting.
205. Question: What is the immediate superclass of the Dialog class?
206. Question: What is clipping?
207. Question: What is a native method?
208. Question: Can a for statement loop indefinitely?
209. Question: What are order of precedence and associativity, and how are they used?
210. Question: When a thread blocks on I/O, what state does it enter?
211. Question: To what value is a variable of the String type automatically initialized?
212. Question: What is the catch or declare rule for method declarations?
213. Question: What is the difference between a MenuItem and a CheckboxMenuItem?
214. Question: What is a task's priority and how is it used in scheduling?
215. Question: What class is the top of the AWT event hierarchy?
216. Question: When a thread is created and started, what is its initial state?
217. Question: Can an anonymous class be declared as implementing an interface and extending a class?
218. Question: What is the range of the short type?
219. Question: What is the range of the char type?
220. Question: In which package are most of the AWT events that support the event-delegation model defined?
221. Question: What is the immediate superclass of Menu?
222. Question: What is the purpose of finalization?
223. Question: Which class is the immediate superclass of the MenuComponent class.
224. Question: What invokes a thread's run() method?
225. Question: What is the difference between the Boolean & operator and the && operator?
Answer :
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 collection200. Question: What restrictions are placed on the location of a package statement within a source code file?
Answer :
A package statement must appear as the first line in a source code file (excluding blank lines and comments)201. Question: Can an object's finalize() method be invoked while it is reachable?
Answer :
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 objects202. Question: What is the immediate superclass of the Applet class?
Answer :
Panel203. Question: What is the difference between preemptive scheduling and time slicing?
Answer :
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 factors204. Question: Name three Component subclasses that support painting.
Answer :
The Canvas, Frame, Panel, and Applet classes support painting205. Question: What is the immediate superclass of the Dialog class?
Answer :
Window206. Question: What is clipping?
Answer :
Clipping is the process of confining paint operations to a limited area or shape207. Question: What is a native method?
Answer :
A native method is a method that is implemented in a language other than Java208. Question: Can a for statement loop indefinitely?
Answer :
Yes, a for statement can loop indefinitely. For example, consider the following: for(;;) ;209. Question: What are order of precedence and associativity, and how are they used?
Answer :
Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left210. Question: When a thread blocks on I/O, what state does it enter?
Answer :
A thread enters the waiting state when it blocks on I/O211. Question: To what value is a variable of the String type automatically initialized?
Answer :
The default value of an String type is null212. Question: What is the catch or declare rule for method declarations?
Answer :
If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause213. Question: What is the difference between a MenuItem and a CheckboxMenuItem?
Answer :
The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked214. Question: What is a task's priority and how is it used in scheduling?
Answer :
A task's priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks215. Question: What class is the top of the AWT event hierarchy?
Answer :
The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy216. Question: When a thread is created and started, what is its initial state?
Answer :
A thread is in the ready state after it has been created and started217. Question: Can an anonymous class be declared as implementing an interface and extending a class?
Answer :
An anonymous class may implement an interface or extend a superclass, but may not be declared to do both218. Question: What is the range of the short type?
Answer :
The range of the short type is -(2^15) to 2^15 - 1219. Question: What is the range of the char type?
Answer :
The range of the char type is 0 to 2^16 - 1220. Question: In which package are most of the AWT events that support the event-delegation model defined?
Answer :
Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package. The AWTEvent class is defined in the java.awt package221. Question: What is the immediate superclass of Menu?
Answer :
MenuItem222. Question: What is the purpose of finalization?
Answer :
The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected223. Question: Which class is the immediate superclass of the MenuComponent class.
Answer :
Object224. Question: What invokes a thread's run() method?
Answer :
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 executed225. Question: What is the difference between the Boolean & operator and the && operator?
No Comment to " 27 Java Interview Questions and Answers part 2 "