Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Why sleep()is in Thread and wait() in Object class? Why can't
I have both in one class or vice versa?



Why sleep()is in Thread and wait() in Object class? Why can't I have both in one class or vic..

Answer / ismail

In Java "Object" class is super for all classes and every
entity we consider as object in java. Every object in java
has default behaviour of "Object" class.

Now come to the point, When you instantiate a thread you
may require to stop a while that particular thread.So
Thread class has sleep method.

But in the situation of multithreading, you may require wait
() and notify() methods so that you can invoke "Object"
class behavior to your class.

Is This Answer Correct ?    7 Yes 3 No

Post New Answer

More Core Java Interview Questions

What do the thread?class methods run() and start() do?

0 Answers  


What are data types in programming?

0 Answers  


What is a “stateless” protocol ?

0 Answers  


List implementations of list interface?

0 Answers  


WAP to illustrate the use of interface

2 Answers  


What is difference between iterator access and index access?

0 Answers  


What is the size of boolean variable?

0 Answers  


diffrence b\w println() and printf()

8 Answers   NIIT,


What is http client in java?

0 Answers  


what is meant by encapsulation?

0 Answers   Aspire,


What is the use of generics? When was it added to the Java development Kit?

0 Answers   Impetus,


What is better - 'bit-shift a value' or 'multiply by 2'?

0 Answers   DELL,


Categories