The moose likes Mock Exam Errata and the fly likes Marcus #38 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Mock Exam Errata
Reply Bookmark "Marcus #38" Watch "Marcus #38" New topic
Author

Marcus #38

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Question 38)
Which of the following statements are true?
1) Code must be written to cause a frame to close on selecting the system close menu
2) The default layout for a Frame is the BorderLayout Manager
3) The layout manager for a Frame cannot be changed once it has been assigned
4) The GridBagLayout manager makes extensive use of the the GridBagConstraints class.
ans)1,2,4
how 1 is correct also??
Thanks!
Bob Kerfoot
Ranch Hand

Joined: Oct 01, 2000
Posts: 47
AVN,
I believe that the question refers to the "Close Alt+F4" menu item in the Control Menu in the upper left corner of a frame as is displayed on a Windows NT system. Since this menu item serves the same purpose as the "X Close" button in the top right corner of the frame, a corresponing call to the windowClosing method will be issued to the frame's WindowListener if one is present. Further, the Java 2 API Specification states that "If the program does not explicitly hide or dispose the window while processing this event, the window close operation will be cancelled."
Therefore, I believe that answer 1 is correct because the window close operation will be cancelled automatically unless you explicitly use a setVisible, dispose, or System.exit method to either remove the frame from the display or exit the application.
Regards,
Bob Kerfoot SCJP - 92%
pete hesse
Ranch Hand

Joined: Aug 29, 2000
Posts: 44
I also didn't choose 1), and although I agree it is a practical necessity to do so, it doesn't cause a compiler or runtime error if you don't.
I suggest the wording be changed in this question, because "must" implies a Java compiler or runtime error will result if not done, which is not the case.
Does Sun's exam word questions this way?
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
Originally posted by pete hesse:
[B]I also didn't choose 1), and although I agree it is a practical necessity to do so, it doesn't cause a compiler or runtime error if you don't.
I suggest the wording be changed in this question, because "must" implies a Java compiler or runtime error will result if not done, which is not the case.
I'm not sure I can see the implication that an error will occur. It specifically says
"must be to cause a frame to close"
Anyone like to suggest a form of words that expresses the intent more clearly? do the words
"needs to be written if you want"
or should it be "must be written if you want to cause"
Anyone got a more compact version of that meaning?
Make it clearer?
Marcus


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
pete hesse
Ranch Hand

Joined: Aug 29, 2000
Posts: 44
I suggest: "Code must be written if you want to cause a frame to close on selecting the system close menu." I took the original wording to mean that if you have a frame, you must code a closing process, regardless.
Your tests are very challenging and useful.
Thanks.
Bob Kerfoot
Ranch Hand

Joined: Oct 01, 2000
Posts: 47
Folks,
I think it makes sense as written.
Bob Kerfoot
 
 
subject: Marcus #38
 
Threads others viewed
Help suggest a proper layout manager for my form
A question about Frame
Layout
Marcus Green q# 38
Layout...
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture