Java Interview Questions - Page 4

Question: What are synchronized methods and synchronized statements? Answer: Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's obj


 

Ads

Tutorials   
Hibernate Interview Questions - What is Hibernate Framework? Hibernate Interview Questions JSF Basic Interview Questions Important Interview Questions in Core Java Core java Interview Questions XML Interviews Question page8,xml Interviews Guide,xml Interviews XML Interviews Question page7,xml Interviews Guide,xml Interviews XML Interviews Question page6,xml Interviews Guide,xml Interviews XML Interviews Question page5,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews XML Interviews Question page30,xml Interviews Guide,xml Interviews XML Interviews Question page29,xml Interviews Guide,xml Interviews XML Interviews Question page28,xml Interviews Guide,xml Interviews XML Interviews Question page27,xml Interviews Guide,xml Interviews XML Interviews Question page26,xml Interviews Guide,xml Interviews XML Interviews Question page25,xml Interviews Guide,xml Interviews XML Interviews Question page24,xml Interviews Guide,xml Interviews XML Interviews Question page23,xml Interviews Guide,xml Interviews XML Interviews Question page22,xml Interviews Guide,xml Interviews XML Interviews Question page21,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews XML Interviews Question page18,xml Interviews Guide,xml Interviews XML Interviews Question page17,xml Interviews Guide,xml Interviews XML Interviews Question page16,xml Interviews Guide,xml Interviews XML Interviews Question page15,xml Interviews Guide,xml Interviews XML Interviews Question page14,xml Interviews Guide,xml Interviews XML Interviews Question page13,xml Interviews Guide,xml Interviews XML Interviews Question page11,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews SQL PL/SQL Terms Deadlock JSF Interview Questions Tomahawk inputCalendar tag Java Questions & Java FAQ J2EE Interviews Question page9,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page8,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page7,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page6,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page5,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page4,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page3,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page20,J2EE Interviews Guide,J2EE Interviews J2EE interview questions page2,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page19,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page18,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page17,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page16,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page15,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page14,J2EE Interviews Guide,J2EE Interviews
Ads

Java Interview Questions - Page 4

     

Question: What are synchronized methods and synchronized statements?  
Answer:
Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement.

Question: What are three ways in which a thread can enter the waiting state? 
Answer:
A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O, by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait() method. It can also enter the waiting state by invoking its (deprecated) suspend() method.

Question: Can a lock be acquired on a class? 
Answer:
Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.

Question: What's new with the stop(), suspend() and resume() methods in JDK 1.2?
Answer:
The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.

Question: What is the preferred size of a component?
Answer:
The preferred size of a component is the minimum component size that will allow the component to display normally.

Question: What method is used to specify a container's layout? 
Answer:
The setLayout() method is used to specify a container's layout.

Question: Which containers use a FlowLayout as their default layout?
Answer:
The Panel and Applet classes use the FlowLayout as their default layout.

Question: What is thread?
Answer:
A thread is an independent path of execution in a system.

Question: What is multithreading?
Answer:
Multithreading means various threads that run in a system.

Question: How does multithreading take place on a computer with a single CPU?
Answer:
The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially.

Advertisements

Share on Google+Share on Google+

Java Interview Questions - Page 4

Posted on: January 9, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: Java Interview Questions - Page 4   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
PRATEEK KUMAR
February 23, 2012
web designing

I want to get tips for web disinging

Ads

 

Ads