Interested in a 10 question Java Quiz.

  • Thread starter Rodney Edmondson
  • Start date
R

Rodney Edmondson

This was done 2 semester ago, and I have checked the answer hundreds
of times, and still come up with the same answers. I got a 70%. Below
is a copy of my answers and the quiz.
My Answers
1. A
2. A
3. B
4. C
5. D
6. A
7. C
8. D
9. B
10. C

There is the 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.
 
M

Mladen Adamovic

It is more JSwing quiz then Java quiz.
I agree with your answers but I must admit that I'm not sure about 50% of
answers. I think quiz is hard and stupid and it is just answer to the
question : did you spend more than 5 hours working with JSwing every day in
the past three months?
 
J

Joona I Palaste

Mladen Adamovic said:
It is more JSwing quiz then Java quiz.
I agree with your answers but I must admit that I'm not sure about 50% of
answers. I think quiz is hard and stupid and it is just answer to the
question : did you spend more than 5 hours working with JSwing every day in
the past three months?

I wholeheartedly agree with Mladen. Whoever designed this quiz has a
very narrow view on Java. If *I* had been told to write a Java quiz, I
would have focused on more language-level aspects instead of a
particular API.
 
J

jb

Joona I Palaste said:
I wholeheartedly agree with Mladen. Whoever designed this quiz has a
very narrow view on Java. If *I* had been told to write a Java quiz, I
would have focused on more language-level aspects instead of a
particular API.

I've been programming with Java since 96, first with CORBA for about 4
yrs and then J2EE for the last 3. I know bordering on nothing about
swing, but I can look up an API, which is all the above test requires.

General Java questions like...tell me about scope in Java? How would
one use notify()? What constructs in Java help me to write thread safe
code? Multi Threaded code? Tell me about Java's use of exceptions? How
would I right exception safe code? Tell me about how Java uses
interfaces?

what does answering a question like the following tell you about my
understanding of Java?
Which of the following is not a valid constructor for a JLabel?
a)JLabel( int, horizontalAlignment, Icon image ); b)JLabel(
Icon image );

Absolutley nothing. For a start lets say ( and I don't know if ..)
(b) is the "wrong" answer, big deal...as far as encapsulation goes
...it seems
reasonable to give a label object a c'tor with Image as an arg?
A better question would be.. examine the JLabel API and discuss its
encapsulation?
 
J

Joona I Palaste

jb said:
I've been programming with Java since 96, first with CORBA for about 4
yrs and then J2EE for the last 3. I know bordering on nothing about
swing, but I can look up an API, which is all the above test requires.
General Java questions like...tell me about scope in Java? How would
one use notify()? What constructs in Java help me to write thread safe
code? Multi Threaded code? Tell me about Java's use of exceptions? How
would I right exception safe code? Tell me about how Java uses
interfaces?
what does answering a question like the following tell you about my
understanding of Java?
Which of the following is not a valid constructor for a JLabel?
a)JLabel( int, horizontalAlignment, Icon image ); b)JLabel(
Icon image );
Absolutley nothing. For a start lets say ( and I don't know if ..)
(b) is the "wrong" answer, big deal...as far as encapsulation goes
..it seems
reasonable to give a label object a c'tor with Image as an arg?
A better question would be.. examine the JLabel API and discuss its
encapsulation?

I have to say I agree with you as well. Learning Java is more... MUCH
more than memorising the JSwing API. You don't learn a foreign language
(for example German if you're English yourself) by reading through the
dictionary, memorising words alphabetically, do you?
Your example questions above are much better than those in the quoted
quiz, but the ones *I'd* ask would go into even more basic concepts of
the Java language.
 

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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top