File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Marcus Mock 3 question #60 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 "Marcus Mock 3 question #60" Watch "Marcus Mock 3 question #60" New topic

Marcus Mock 3 question #60

Ranch Hand

Joined: Dec 06, 2000
Posts: 35
here is the code for question 60:
I think the answer is none of the given answer. My argument is that the method fliton() has a return value, should it be assigned to a variable ?
Anyone plz help me with this!!

public class Ppvg{
public static void main(String argv[]){
Ppvg p = new Ppvg();
//note: fliton method return an int value, does this //need to assign the return value to a variable?
public int fliton(){
DataInputStream din = new DataInputStream(;
}catch(IOException ioe){
return 99;

return -1;

Which of the following statements are true if you try to compile and run the program?
1) The program will run and output only "flytwick"
2) The program will run and output only "fliton"
3) The program will run and output both "fliton" and "flytwick"
4) An error will occur at compile time because the method fliton attempts to return two values


Joined: Jun 26, 2000
Posts: 25
Its not necessary to assign a return value. Try it yourself. ;-)
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi Jason,
the answer is 2 the reason is that just because a method has a return value does not mean that one should save this value. it is based on a need assessement. if i do not want it i may not save the return value else I may.
Thus It is not compulsory to save the value returned by a method.
dan pahl

Joined: Aug 08, 2007
Posts: 3
Where can I find Marcus Mock 3?
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Marcus has carefully hidden it next to his Exam 2. Just look at the URL, and make a guess at where exam 3 might be located.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: Marcus Mock 3 question #60
It's not a secret anymore!