File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Surprisingly no error... 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 "Surprisingly no error..." Watch "Surprisingly no error..." New topic
Author

Surprisingly no error...

sonir shah
Ranch Hand

Joined: Nov 01, 2001
Posts: 435

Options:
A: The code does not compile due to line //1.
B: The code does not compile due to line //2.
C: The code does not compile due to line //3.
D: The code does not compile due to line //4.
E: There is nothing wrong with the code.
Ans: E)Nothing wrong with the code..
My question is can we implement Thread.yield() is called when is no start() and no run ().Should it compile? And Surprisingly , the output printed is "false"!!!
Can any one explain me?
Sonir
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
When you run your program (the main method is invoked by the interpreter) you have at least one thread running, the "main" thread. Thus invoking Thread.yield() is perfectly legal...
HIH
[ January 21, 2002: Message edited by: Valentin Crettaz ]

SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
The reason "false" is output is that o is a reference to an object. It does not contain a null value.


Matthew Phillips
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Surprisingly no error...
 
Similar Threads
q from jiris.com
static final int allowed in non-static inner class
Jxam String question
Clarification on Jxam questions
Resolve.........