Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Questions and Answers (in comment) 1.(TCO 1) Which command compiles the Java sou

ID: 3560915 • Letter: Q

Question

Questions and Answers (in comment)

1.(TCO 1) Which command compiles the Java source code file Welcome.java?

2.(TCO 1) What is the default value of a reference variable?

3.(TCO 1) Which method call converts the value in variable stringVariable to an integer?

4.(TCO 1) Which line below creates a String object that displays the value of current to 3 decimal digit accuracy, given voltage and resistance variables which are of type double?

5.(TCO 1) Which of the following is the method used to display a dialog box to gather input?

6.(TCO 1) What do the following statements do?

7.(TCO 2) Static methods of a class

8.(TCO 2) What can you say about the following Java class?

9.(TCO 3) Which layout manager is the default for JFrame?

10.(TCO 3) What is the default layout manager of a JPanel?

11.(TCO 3) BorderLayout

12.(TCO 3) In order to guarantee that only one JRadioButton is selected at any time,

13.(TCO 3) Which of the following creates a single line display which is not user editable?

14.(TCO 4) Which of the following does not generate an event?

15.(TCO 4) Which of the following are the correct steps for setting up event handling for a GUI component?

16. (TCO 4) What can you say about the following Java class definition?

public class MyApp extends JFrame implements ActionListener {

Explanation / Answer

1. javac
2. NULL
3. Integer.parseInt()
4. String result = String.format("The current is %.3f", voltage/resistance);
5. showInputDialog
6. Creates a double dimensioanl array containing 14 elements.
7. can be called without the instantiation of the class, using the class name itself.
8. MyApp will not compile because java will not allow multiple inheritance
9. BorderedLayout
10. FlowLayout
11. Divides a container into 5 geographical sections
12. Have a JCheckBox object manage the three JRadioButtons.
13. JLabel display = new JLabel(