Results 1 to 4 of 4

Thread: Java FAQ's

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Answers
    3

    Exclamation Java FAQ's

    Hi ,
    Can u tell me why is wait,Notify,Notifyall methods declared in object class only.


  2. #2
    Junior Member
    Join Date
    Sep 2007
    Answers
    8

    Smile Re: Java FAQ's

    Because for every class u create in java, the base class is Object..hope u got


  3. #3
    Junior Member
    Join Date
    Sep 2007
    Answers
    3

    Re: Java FAQ's

    Ok thats fine,But why is these methods declared in Object class rather than Thread class.My real question is we r using this methods only in threads not for any other purposes. so Iam still not agreeing to ur answer.


  4. #4
    Junior Member
    Join Date
    Sep 2007
    Answers
    8

    Smile Re: Java FAQ's

    Hi

    All those methods uses the lock on the object.locks are acquired and released at the object level.. since Object is the base class for all the classes,those methods are in Object class.. hope u are clear now.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact