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

True or false: 1. You cannot store user-defined objects into an ArrayList. 2. Ex

ID: 3888066 • Letter: T

Question

True or false:

1. You cannot store user-defined objects into an ArrayList.

2. Example syntax for opening a file for reading is: BufferedReader in = new BufferedReader(new FileReader("stars.txt"));

3. FileWriter allows you to append to a file.

4. The setText() method can be used to set the value of a jTextField.

5. The isSelected() method can be used to determine if a jRadioButton has been selected.

6. A Swing application uses GUI components from the java.swing package.

7. To write out a platform independent line separator to a file, you could write out the String that is returned from System.getProperty (“line.separator”).

8. You could use the printf() method to write formatted output to a file if you use PrintWriter.

9. You could use the hasNext() method on the Scanner class to see if you had more data to read in.

10. You could use the value returned from the getText() method on the jTextField class in a mathematical operation without first converting to a numeric type.

Explanation / Answer

1. You cannot store user-defined objects into an ArrayList.

Answer: False

2. Example syntax for opening a file for reading is: BufferedReader in = new BufferedReader(new FileReader("stars.txt"));

Answer: True

3. FileWriter allows you to append to a file.

Answer: True

4. The setText() method can be used to set the value of a jTextField.

Answer: True

5. The isSelected() method can be used to determine if a jRadioButton has been selected.

Answer: True

6. A Swing application uses GUI components from the java.swing package.

Answer: False. it should be javax.swing.

7. To write out a platform independent line separator to a file, you could write out the String that is returned from System.getProperty (“line.separator”).

Answer: True

8. You could use the printf() method to write formatted output to a file if you use PrintWriter.

Answer: True

9. You could use the hasNext() method on the Scanner class to see if you had more data to read in.

Answer: True

10. You could use the value returned from the getText() method on the jTextField class in a mathematical operation without first converting to a numeric type.

Answer: False

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote