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 Wrapper Q - JDiscuss - Wrong Answer Given Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Wrapper Q - JDiscuss - Wrong Answer Given" Watch "Wrapper Q - JDiscuss - Wrong Answer Given" New topic
Author

Wrapper Q - JDiscuss - Wrong Answer Given

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026

What will happen if it is run with the following command line:
java Parser one

ptions
Select 1 correct option.

1.It will print 'Problem in 0'
2.It will throw an exception and end without printing anything.
3.It will not even compile.
4.It will not print anything if the argument is '1' instead of 'one'.
5.None of the above.


Answer given is: option 5

Correct answer is: option 1

Comment


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Satish Chilukuri
Ranch Hand

Joined: Jun 23, 2005
Posts: 266
When you are in doubt the best thing to do is to compile the code and execute it yourself. The output you get is **THE** correct answer regardless of the what the test answer might say.

Coming to the question, the answer is neither option 1 nor option 5. It is option 3. The variable i is not visible to the catch block.
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Thanks satish
latha yeduguri
Greenhorn

Joined: Jun 24, 2005
Posts: 17
It won't even compile as it can't recognize the variable i.
Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
wont compile due to the reason variable i .


From NickyEng
Diploma in Computer Studies
SCJP 1.4
SCWCD 1.4
Formula 1 app by Maxis (Playbook)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Wrapper Q - JDiscuss - Wrong Answer Given