Thursday 29 September 2011

Java Interview Questions Part 8

1. What class is the top of the AWT event hierarchy? The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy.
2. When a thread is created and started, what is its initial state?
A thread is in the ready state after it has been created and started.
3. Can an anonymous class be declared as implementing an interface and extending a class?
An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.
4. What is the range of the short type?
The range of the short type is -(2^15) to 2^15 – 1.
5. What is the range of the char type?
The range of the char type is 0 to 2^16 – 1.
6. In which package are most of the AWT events that support the event-delegation model defined?
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 package.
7. What is the immediate superclass of Menu?
MenuItem
8. What is the purpose of finalization?
The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.
9. Which class is the immediate superclass of the MenuComponent class.
Object
10. 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.

0 comments:

Post a Comment

INDIA ENOW

How do u rate my blog?

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More