This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Deprecated Methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Deprecated Methods" Watch "Deprecated Methods" New topic
Author

Deprecated Methods

Srikanth Madduri
Greenhorn

Joined: Jun 19, 2000
Posts: 10
Hi all,
Could someone help me with info on methods of Java 1.1 (like suspend(), resume(), stop()....etc.).
In Java 1.2 these methods have been deprecated. Is there a possibility that questions will be asked on these methods? If so, how do we answer the questions?
Thanks
Srikanth
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hello Srikanth
I would spend the extrat 10 minutes learning what these methods can do for you. I have seen them alot on the pratice exams.
Monty6
Srikanth Madduri
Greenhorn

Joined: Jun 19, 2000
Posts: 10
Monty6,
Thanks for the response. Learning them is fine. But the problem persists.......for example...
Q. Which of the following methods change the state of the thread to Waiting. Select all the valid answers.
a. yield();
b. wait();
c. suspend();
d. sleep();
e. stop();
In the above question, we know that b and d are valid in Java 1.2. But c is valid in Java 1.1. So what're the valid answers?
Regards
Srikanth
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Q. Which of the following methods change the state of the thread to Waiting.
Select all the valid answers.
a. yield();
b. wait();
c. suspend();
d. sleep();
e. stop();
"In the above question, we know that b and d are valid in Java 1.2. But c is valid in Java 1.1. So what're the valid answers?"
MOST emphatically, d does not put a Thread in a waiting state, it put the Thread in a sleep state - entirely different. The wait state involves a lock on an object, sleep does not and neither does suspend. A wait-ing Thread can have a sleep like time limit but it is not the same thing.
The suspend and resume methods are deprecated because a Thread that has a lock on an object (via synchronized) will keep the lock while it is suspended - a very likely way to lock up the entire JVM.
You may be asked to recognize that a method has been deprecated but you will not be asked to use a deprecated method to solve a programming problem on the test.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deprecated Methods
 
Similar Threads
Deprecation questions
Threads ???
Threads
Help Please...
Deprecated API