The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes macrus mock exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "macrus mock exam" Watch "macrus mock exam" New topic

macrus mock exam

shabbir zakir
Ranch Hand

Joined: Nov 12, 2000
Posts: 183
What can cause a thread to stop executing?
1) The program exits via a call to System.exit(0);
2) Another thread is given a higher priority
3) A call to the thread's stop method.
4) A call to the halt method of the Thread class
the correct answer given is 1,2,4
I understand 1,2 can come.But how option 3.the stop()method have deprecated.
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
could you rephrase your qstn., i think you have a typo abt
ans 3 or 4 ?
- satya

Take a Minute, Donate an Hour, Change a Life
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

Deprecated methods still work. It is just recommeneded not to use them.

Visit my download page
Pratap Reddy
Ranch Hand

Joined: Jan 05, 2001
Posts: 36
(2) Another thread is given a higher priority. I don't think
by assigning high priority will let other threads to stop.
Correct answer in my opinion : 1 & 3. And regarding (4) I am not clear.
[This message has been edited by Pratap Reddy (edited January 08, 2001).]
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
If the application is running a system that uses 'time-slicing' a higher priority thread may pre-empt a lower priority thread; causing it to stop.
There is no method Thread.halt()
Hope that helps.
The cure for boredom is curiosity.
There is no cure for curiosity.
-- Dorothy Parker

Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Marcus Green
arch rival

Joined: Sep 14, 1999
Posts: 2813
Note that the question says what CAN cause a thread, not what WILL cause a thread. An important difference.

SCWCD: Online Course, 50,000+ words and 200+ questions
Vladimir Kositsky
Ranch Hand

Joined: Nov 03, 2000
Posts: 116
*yield CPU to other thread postpone execution of thread ( IMHO ).
*halt method - it could be interrupt()

[This message has been edited by Vladimir Kositsky (edited January 09, 2001).]
I agree. Here's the link:
subject: macrus mock exam
It's not a secret anymore!