Easy Java Quiz: Are you interested?

  • Thread starter Rodney Edmondson
  • Start date
R

Rodney Edmondson

Hi; to all you gurus out there,
I did this quiz two semester ago, I got 70%, but however I tend to
differ with the result. I have cross-checked this a hundred times, I
still come with the same answers. So I wanted to see, if all you guys
will come up with the same answer. Do you think, you are up to it.
well here, it is, with my answers, and I stick by them, if anyone
differs put yours up, or email answers with reasons, for I am really
interested.

My Answers
1. A
2. A
3. B
4. C
5. D
6. A
7. C
8. D
9. B
10. C

Quiz:

1. Which of the following is not a specific GUI component (control or
widgit)?
a)String. b)Label. c)Menu. d) List.
2. Which of the following is not a valid constructor for a JLabel?
a)JLabel( int, horizontalAlignment, Icon image ); b)JLabel(
Icon image );
c)JLabel( String text, Icon image, int horizontalAlignment );
d)JLabel( String text, int horizontalAlignment );
3. Which of the following is not necessary to use the event
delegation model?
a) An event listener must be registered. b)An event handler must be
implemented.
c) The appropriate interface must be implemented. d)The appropriate
interface must be registered.
4. Which of the following is a MouseMotionListener method?
a) mousePressed. b) mouseExited. c)mouseDragged.
d)mouseClicked.
5. The layout manager that allows alignment to be controlled is:
a) FlowLayout. b) BorderLayout. c)GridLayout. d)None of the above.
6. Which of the following GridBagConstraints specifies the number of
columns a component will occupy?
a) gridwidth. b)gridheight. c) weightx. d)weighty.
7. A JFrame supports three operations when the user closes the
window. Which of the choices below is not one of the three:
a) DISPOSE_ON_CLOSE. b)DO_NOTHING_ON_CLOSE. c)LOWER_ON_CLOSE.
d)HIDE_ON_CLOSE.
8. To create a fixed space between all components using BoxLayout,
use the method:
a) createVerticalStrut(). b)createHorizontalStrut(). c)createGlue().
d)createRigidArea().
9. Which layout manager is the default for JFrame?
a) FlowLayout. b)BorderLayout. c)GridLayout. d)None of the above.
10. When a JComboBox is clicked on:
a)An ItemEvent is generated. b)A scrollbar is always generated. c)An
ActionEvent is generated. d)The JComboBox expands to a list.
 
W

Wendy S

Rodney Edmondson said:
Hi; to all you gurus out there,
I did this quiz two semester ago, I got 70%, but however I tend to
differ with the result. I have cross-checked this a hundred times, I
still come with the same answers. So I wanted to see, if all you guys
will come up with the same answer.

Well, I was going to play, but I don't do graphical stuff.
You might want to post it on comp.lang.java.gui instead.
 
C

Chris Smith

Rodney said:
I did this quiz two semester ago, I got 70%, but however I tend to
differ with the result.

Though I think a lot of the questions are bad, if I had to write an
answer key and couldn't change the question wording, you'd have gotten a
70% (missed 3, 5, and 10). The questions that I think are wrong or
misleading are:

1. java.awt.Menu is not a GUI component (which is how I'd interpret the
words "control" or "widget"), but rather a mere data structure, used to
implement a native capability of the java.awt.Frame and java.awt.Dialog
classes. Furthermore, saying "List" doesn't make it clear whether the
questioner means java.awt.List or java.util.List. Nevertheless, String
is clearly out of place, so I'd pick that one as the best answer.

3. The wording here is very poor, but in the end, the answer is clear
because "registering" an interface doesn't have any possible meaning in
the context of an event handler, whereas I can construe the rest to
refer to something in the AWT event idiom.

7. This one's just plain wrong, since a JFrame clearly also supports
EXIT_ON_CLOSE. Nevertheless, LOWER_ON_CLOSE is obviously out of place.

9. Who cares about the default layout for a JFrame? However, it does
happen to be BorderLayout on my JRE here, which is coincidentally also
the right answer for the question that was intended (layout manager for
the content pane of a JFrame).

10. All of these things might happen, depending on where the mouse click
is, and the current state of the JComboBox. The only answer that's
clearly wrong is (b) because it includes the word "always". In the end,
I'm going with "D" because it is probably the answer for the most common
clicks on a JComboBox in the most common state. Additionally, according
the the API docs at least, it seems that A and C would have to either
both be right and both be wrong, and they require prior clicks on the
JComboBox to have already occurred, making them a little more
questionable.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top