Wednesday, September 24, 2008

Java Interview Questions and Answers -java

1)What are the problems faced by Java programmers who don't use layout managers?

Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints imposed by each windowing system.

2)What is the difference between static and non-static variables?


A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.

3)What is the difference between the paint() and repaint() methods?


The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread.

4)What is the purpose of the File class?

The File class is used to create objects that provide access to the files and directories of a local file system.

5)Why would you use a synchronized block vs. synchronized method?
Synchronized blocks place locks for shorter periods than synchronized methods.

No comments:

Post a Comment

Thanks to given comments.......

My Blog List