aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes jtips mock 1 Q33 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 "jtips mock 1 Q33" Watch "jtips mock 1 Q33" New topic
Author

jtips mock 1 Q33

Neha Sawant
Ranch Hand

Joined: Oct 11, 2001
Posts: 204
Q33 from jtips mock 1
I thought it should give compiler error,statement not reached but ans given is 18.
Please help
Given:

What is the Output?
1.Prints 10
2.Prints 28
3.Compile-time error occurs.
4.Prints 18.
5.Prints 27
regards
neha

(Marilyn added code tags)
[This message has been edited by Marilyn deQueiroz (edited November 27, 2001).]


nss
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Answer is wrong. It gives a compile error. Try to compile the code and you'll see it. The only construct with which you can use false is with "if" so that you may insert debug conditional compilation.
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Magnus Lidman
Greenhorn

Joined: Nov 27, 2001
Posts: 2
If you use JBuilder, it'll compile (but the statement will hopefully be optimized away), but if you use SUN's own compiler (javac) you'll get the error.
Guess the author of the mock-exam uses JBuilder or something similar.
Originally posted by Valentin Crettaz:
[b]Answer is wrong. It gives a compile error. Try to compile the code and you'll see it. The only construct with which you can use false is with "if" so that you may insert debug conditional compilation.
HIH
[/B]

Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Thanks Magnus, those kind of things are always good to know...
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
Neha Sawant
Ranch Hand

Joined: Oct 11, 2001
Posts: 204
thanx Mangus and Valentin
Regards
Neha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jtips mock 1 Q33