wood burning stoves 2.0*
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


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

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 ?
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

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


SCJP
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
Pratap,
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.
------------------
Jane
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
Rancher

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.
Marcus


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
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).]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: macrus mock exam
 
Similar Threads
Marcus Green Exam 2 Question 22 On threads
Threads
Marcus Green Exam 2, Question #22
Marcus Mock exam 2 Threads
Marcus Green exam 2