Question: Flag this Question Question 14 pts (TCOs 16) The component that can be used to display query results from a database in a grid of
Flag this Question
Question 14 pts
(TCOs 16) The component that can be used to display query results from a database in a grid of rows and columns is
| JTable. |
| JGrid. |
| DBTable. |
| DBGrid. |
Flag this Question
Question 24 pts
(TCOs 16) What is the output of the code below? double num = 56.4321; System.out.printf("%.2f", 56.4321);
| %.2f |
| %.2f56.4321 |
| 56.43 |
| 56.4321 |
Flag this Question
Question 34 pts
(TCOs 16) The signature of a method consists of
| method name and parameter list. |
| return type |
| method name. |
| parameter list. |
Flag this Question
Question 44 pts
(TCOs 16) Assume int[ ] t = {1, 2, 3, 4}. What is t.length?
| 5 |
| 4 |
| 0 |
| 3 |
Flag this Question
Question 54 pts
(TCOs 1, 2, and 6) A key part of enabling the JVM to locate and call method main to begin the apps execution is the _____ keyword, which indicates that main can be called without first creating an object of the class in which the method is declared.
| class |
| private |
| static |
| public |
Flag this Question
Question 64 pts
(TCOs 16) Invoking _____ returns the first element in an ArrayList x.
| x.get(1) |
| x.get() |
| x.get(0) |
| x.first() |
Flag this Question
Question 74 pts
(TCOs 1, 4, and 6) Consider a form with a ButtonGroup with three radio buttons, and two check boxes. What is the total number of radio buttons and check boxes that can be selected at any time?
| 5 |
| 4 |
| 3 |
| 2 |
Flag this Question
Question 84 pts
(TCOs 16) Analyze the following code. public class Test { int x; public Test(String t) { System.out.println("Test"); } public static void main(String[ ] args) { Test test = null; System.out.println(test.x); } }
| The program has a compile error because x has not been initialized. |
| The program has a runtime NullPointerException because test is null while executing test.x. |
| The program has a compile error because test is not initialized. |
| The program has a compile error because Test does not have a default constructor. |
Flag this Question
Question 94 pts
(TCOs 16) Suppose ArrayList x contains two strings [Beijing, Singapore]. Which of the following methods will cause the list to become [Beijing, Chicago, Singapore]?
| x.add("Chicago") |
| x.add(2, "Chicago") |
| x.add(0, "Chicago") |
| x.add(1, "Chicago") |
Flag this Question
Question 104 pts
(TCOs 1, 5, and 6) Which statement sets up a tokens object that will use the % as a field delimiter?
| tokens = StringTokenizer(inputString, "%"); |
| tokens = new StringTokenizer(inputString, "%"); |
| tokens = StringTokenizer("%", inputString); |
| tokens = new StringTokenizer("%", inputString); |
Flag this Question
Question 114 pts
(TCOs 16) The title of a JFrame can be set by using which statement in the constructor of your class that extends JFrame?
| super(Title here); |
| setFrameTitle(Title here); |
| setTitleFrame(Title here); |
| JFrame.super(Title here); |
Flag this Question
Question 124 pts
(TCOs 1, 5, and 6) Which type of exception occurs if the file cannot be created by a FileWriter object?
| FileError |
| FileException |
| FileIOException |
| IOException |
Flag this Question
Question 134 pts
(TCOs 16) What layout manager should you use so that every component occupies the same size in the container?
| any layout |
| a FlowLayout |
| a BorderLayout |
| a GridLayout |
Flag this Question
Question 144 pts
(TCOs 16) The _____ method of an event object returns the object that caused the event.
| getSource() |
| getEvent() |
| getEventObject() |
| getWhen() |
Flag this Question
Question 154 pts
(TCOs 16) The datatype returned by the JOptionPane.showInputDialog method is
| String. |
| int. |
| double. |
| specified by the user in the method call. |
Flag this Question
Question 164 pts
(TCOs 1, 4, and 6) Menus are attached to windows by calling the _____ method.
| addMenuBar |
| setJMenuBar |
| setMenu |
| addJMenuBar |
Flag this Question
Question 174 pts
(TCOs 16) Set methods are also commonly called _____ methods, and get methods are also commonly called _____ methods.
| query, mutator. |
| accessor, mutator. |
| mutator, accessor. |
| query, accessor. |
Flag this Question
Question 184 pts
(TCOs 1, 4, and 6) The method used to add panels to a JTabbedPane is
| newTab. |
| newPanel. |
| addPanel. |
| addTab. |
Flag this Question
Question 194 pts
(TCOs 16) A programmer-defined constructor that has no arguments is called a(n)
| empty constructor. |
| no-argument constructor. |
| default constructor. |
| null constructor. |
Flag this Question
Question 204 pts
(TCOs 16) A method that is associated with an individual object is called
| an object method. |
| an instance method. |
| a class method. |
| a static method. |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
