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 is the collable collections in java?

2 Answers   Persistent,


What is I/O Filter?

2 Answers   TCS, WAX,


Given: 1. package test; 2. 3. class Target { 4. public String name = “hello”; 5. } What can directly access and change the value of the variable name? 1 any class 2 only the Target class 3 any class in the test package 4 any class that extends Target

7 Answers   Infosys, WW,


Explain purpose of sleep() method in java?

0 Answers  


explain the clone method and clonable interface

1 Answers  


What is an accessor?

1 Answers   BirlaSoft,


What is the use of 'super' keyword inside a constructor?

0 Answers   Flextronics, Thomson Reuters, Virtusa,


How is it possible for two string objects with identical values not to be equal under the == operator?

0 Answers  


difference between byte stream class and character stream class?

0 Answers  


What is constructor chaining and how is it achieved in java?

0 Answers  


What is "this" keyword in java? Explain

0 Answers  


What does method mean?

0 Answers  


Categories