Question 14 Pts Tcos 1 6 Column Names Displayed Jtable Specified Using Method Defaulttable Q23522195

Question 14 pts

(TCOs 1–6) The column names that are displayed in a JTable canbe specified by using the _____ method of theDefaultTableModel.

.formatColumns
.setColumns
.setColumnNames
.setColumnIdentifiers

Flag this Question

Question 24 pts

(TCOs 1–6) 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 1–6) 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 1–6) 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) If a class contains a main method, thatmethod is executed

automatically when the class is run.
when another method within the class calls it.
when an object is created from the class.
None of the above

Flag this Question

Question 64 pts

(TCOs 1–6) Invoking _____ returns the first element in anArrayList x.

x.get(1)
x.get()
x.get(0)
x.first()

Flag this Question

Question 74 pts

(TCO 1, 4, and 6) The maximum number of radio buttons that canbe selected within a ButtonGroup is

1.
2.
5.
all.

Flag this Question

Question 84 pts

(TCOs 1–6) Which statements are most accurate regarding thefollowing classes?

class A {
      private int i;
      protected int j;
}
class B extends A {
      private int k;
      protected int m;
}

An object of B contains data fields j, m.
An object of B contains data fields j, k, m.
An object of B contains data fields k, m.
An object of B contains data fields i, j, k, m.

Flag this Question

Question 94 pts

(TCOs 1–6) Suppose ArrayList x contains two strings[Beijing, Singapore]. Which of the following methods will cause thelist 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) The StringTokenizer method used to return thenext field based on the delimiter character specified is

nextField.
nextToken.
Token.
Field.

Flag this Question

Question 114 pts

(TCOs 1–6) Which of the following statements causes the programto terminate when closing the frame?

frame.setDefaultCloseOperation(null)
frame.setDefaultCloseOperation(JFrame.STOP_ON_CLOSE)
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
frame.setDefaultCloseOperation(JFrame.TERMINATE_ON_CLOSE)

Flag this Question

Question 124 pts

(TCOs 1, 5, and 6) Which type of exception occurs if the writemethod of BufferedWriter cannot write data to the file?

WriteException
IOException
FileIOException
FileException

Flag this Question

Question 134 pts

(TCOs 1–6) What layout manager should you use so that everycomponent occupies the same size in the container?

any layout
a FlowLayout
a BorderLayout
a GridLayout

Flag this Question

Question 144 pts

(TCOs 1–6) The event handler (e.g., actionPerformed) is a methodin

both source and listener object.
the EventObject class.
a listener object.
a source object.

Flag this Question

Question 154 pts

(TCOs 1–6) The _____ method of JOptionPane is used to display amessage dialog box.

showMessage
displayMessageDialog
showMessageDialog
displayMessage

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 1–6) Suppose you wish to provide an accessor method for adouble instance variable named percent, what should the signaturemethod be?

public static void getPercent()
public double getPercent()
public int getPercent()
public void getPercent()

Flag this Question

Question 184 pts

(TCOs 1, 4, and 6) The method used to add panels to aJTabbedPane is

newTab.
newPanel.
addPanel.
addTab.

Flag this Question

Question 194 pts

(TCOs 1–6) A constructor cannot

be overloaded.
initialize variables to their defaults.
specify return types or return values.
have the same name as the class.

Flag this Question

Question 204 pts

(TCOs 1–6) Given the declaration Circle x = new Circle(), whichof the following statements is most accurate?

x contains an int value.
You can assign an int value to x.
x contains an object of the Circle type.
x contains a reference to a Circle object.

Flag this Question

Question 214 pts

(TCOs 1, 5, and 6) To add a database driver to a NetBeansproject, you can add the JAR file for the driver to whatfolder?

The Source Packages folder
The Libraries folder
The Files folder
The Services folder

Flag this Question

Question 224 pts

(TCOs 1–6) _____ represents an entity in the real world that canbe distinctly identified.

A class
An object
A data field
A method

Flag this Question

Question 234 pts

(TCOs 1–6) To execute the query “select * from Address” usingthe Statement object named stmt that has been properly configuredwith a database connection, use

stmt.executeUpdate(“select * from Address”);.
stmt.execute(“select * from Address”);.
stmt.executeQuery(“select * from Address”);.
stmt.query(“select * from Address”);.

Flag this Question

Question 244 pts

(TCOs 1–6) Suppose that your program accesses a MySQL database.Which of the following statements is false?

If the database is not available, the program will have aruntime error when attempting to create a connection object.
If the driver for MySQL database is not in the classpath, theprogram will have a runtime error, indicating that the driver classcannot be loaded.
If the driver for MySQL database is not in the classpath, theprogram will have a syntax error.
If the database connection cannot be made, a SQLExceptionoccurs.

Flag this Question

Question 254 pts

(TCOs 1–6) Which of the following statements is false?

PreparedStatement is for SQL SELECT statements only. You cannotcreate a PreparedStatement for SQL UPDATE statements.
The parameters in a prepared statement are denoted using the ?sign.
PreparedStatement is efficient for repeated executions.
The first parameter in a perpared statement is number 1.

Flag this Question

Question 264 pts

(TCOs 1–6) Which method can be used to write data to a text fileopened with the BufferedWriter object outfile?

outfile.newLine();
outfile.existLine();
Write(outfile);
outfile.write();

Flag this Question

Question 274 pts

(TCOs 1–6) Which type of exception occurs when creating aBufferedReader object for a nonexistent file?

FileNotExist
FileNotFound
FileNotExistException
FileNotFoundException

Flag this Question

Question 284 pts

(TCOs 1–6) Which class can be used to write data into a textfile?

File
BufferedWriter
FileWrite
WriteFile

Flag this Question

Question 294 pts

(TCOs 1–6) Result set meta data are retrieved through

a Statement object.
a Connection object.
a ResultSet object.
a PreparedStatement object.

Flag this Question

Question 304 pts

(TCOs 1–6) Clicking a JCheckBox object generates _____events.

ComponentEvent
ContainerEvent
ActionEvent
JCheckBoxEvent

Flag this Question

Question 314 pts

(TCOs 1–6) The method _____ gets the contents of the text fieldtxtName.

txtName.findString()
txtName.getText(s)
txtName.getString()
txtName.getText()

Flag this Question

Question 324 pts

(TCOs 1–6) The method _____ appends a string s into thetext area jta.

jta.appendText(s)
jta.append(s)
jta.setText(s)
jta.insertText(s)

Flag this Question

Question 334 pts

(TCOs 1–6) The method _____ gets the text (or caption) of thebutton btnAdd.

btnAdd.text()
btnAdd.findText()
btnAdd.retrieveText().
btnAdd.getText()

Flag this Question

Question 344 pts

(TCOs 1–6) A JList object can be populated with data stored ina(n) _____ object.

ModelList
DefaultListModel
ListArray
DefaultModelList

Flag this Question

Question 354 pts

(TCOs 1–6) The _____ method of a check box returns true if thatbutton is “checked”.

isSelected()
getSelected()
Selected()
isChecked()
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *