OOPS and Core Java Interview Question and Answers

37. Why are the AWT components called the Heavy Weight Components?
  For a same application program, AWT components occupy more memory space than swing components. Moreover, AWT components are implemented by platform-specific code, while the swing components are platform-independent. Therefore, AWT components are called 'Heavy Weight Components', while, Swing components, called Light Weight Components.
 
Your Name Your Email-ID
Your Answer
38. What is called Synchronization with respect to multithreading?
 
  • When two or more threads need access to a shared resource, they need some way to ensure that the resource will be used by only one thread at a time.
  • The process by which this is achieved is called synchronization.
  • The key to synchronization is the concept of the monitor (also called a semaphore).
  • A monitor is an object that is used as mutually exclusive lock (or mutex).
  • Only one thread can own a monitor at a given time.
 
Your Name Your Email-ID
Your Answer
39. Describe a File class in Java.io. package?
 
  • The File class does not specify how the information is retrieved from or stored in files; it describes the properties of a file itself.
  • A File object is used to obtain or manipulate the information associated with a disk file, such as the permissions, time, date, and directory path and to navigate subdirectory hierarchies.
 
Your Name Your Email-ID
Your Answer
40. Distinguish between Applets and Servlets with respect to their functionality?
 
  • Applets provide a way of dynamically extended functionality of client side web browsers, whereas servlets dynamically extend the functionality of network servers.
  • Servlets are to servers what Applets are to browsers.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 10 of 10