Exam 3: Introduction to Objects and Input/output

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The class JOptionPane allows a programmer to use graphical interface components to obtain input from a user.

Free
(True/False)
4.8/5
(43)
Correct Answer:
Verified

True

In a format specifier, if the flag is set to 'l', then the output of the result is left justified.

Free
(True/False)
4.9/5
(25)
Correct Answer:
Verified

False

To use the contents of the java.lang package in a program, they must be imported using the import statement.

Free
(True/False)
4.9/5
(26)
Correct Answer:
Verified

False

Suppose str is a String variable. The statement str = new String("Programming"); is similar to which of the following?

(Multiple Choice)
4.8/5
(37)

Given a decimal number, the method format of the class String returns the string containing the digits of the formatted number.

(True/False)
4.7/5
(32)

What happens when JOptionPane.PLAIN_MESSAGE is chosen as the messageType parameter?

(Multiple Choice)
4.9/5
(40)

The class JOptionPane is part of the package java.swing.

(True/False)
4.9/5
(31)

In order to use a predefined method, you only need to know the name of the method and the type of each parameter.

(True/False)
4.8/5
(40)

Which of the following is a valid statement? (i) int num = new int(67); (ii) String name = new ("Doe"); (iii) String name = "Doe";

(Multiple Choice)
4.8/5
(42)

Suppose that name is a String variable. Then the following two statements are equivalent.name = "Danny"; name = new String("Danny");

(True/False)
4.9/5
(39)

String sentence; String str1, str2, str3, str4; Int length1;sentence = "First exam is on Monday.";str1 = sentence.substring(6, 12); Str2 = str1.substring(0, 4); Str3 = sentence.replace('i', '#'); Str4 = sentence.indexOf("on");length1 = sentence.length();Based on the code above, what is the value of length1?

(Multiple Choice)
4.7/5
(39)

The showMessageDialog method has ____ parameter(s).

(Multiple Choice)
4.9/5
(45)

String objects are mutable.

(True/False)
4.9/5
(34)

String sentence; String str1, str2, str3, str4; Int length1;sentence = "First exam is on Monday.";str1 = sentence.substring(6, 12); Str2 = str1.substring(0, 4); Str3 = sentence.replace('i', '#'); Str4 = sentence.indexOf("on");length1 = sentence.length();Based on the code above, what is the value of str1?

(Multiple Choice)
4.8/5
(29)

Which of the following outputs 56734.9875 to three decimal places?

(Multiple Choice)
4.9/5
(33)

The default output of decimal numbers of the type float is up to nine decimal places.

(True/False)
4.9/5
(39)

Reference type variables directly store data into their memory space.

(True/False)
4.9/5
(34)

String sentence; String str1, str2, str3, str4; Int length1;sentence = "First exam is on Monday.";str1 = sentence.substring(6, 12); Str2 = str1.substring(0, 4); Str3 = sentence.replace('i', '#'); Str4 = sentence.indexOf("on");length1 = sentence.length();Based on the code above, what is the value of str2?

(Multiple Choice)
4.8/5
(34)

Suppose the String variable str points to the String object "Sunny day" at the memory address 3600. Then the value of str is:

(Multiple Choice)
4.9/5
(35)

In the class String, the substring method inserts a string into another string.

(True/False)
4.7/5
(30)
Showing 1 - 20 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)