Exam 3: Introduction to Objects and Inputoutput

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

Based on the code above, what is the value of length1?

Free
(Multiple Choice)
4.7/5
(34)
Correct Answer:
Verified

C

Suppose z = 1834.762. The output of the statement System.out.printf("%.1f", z); is 1834.800.

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

False

String variables are reference variables.

Free
(True/False)
4.7/5
(36)
Correct Answer:
Verified

True

What is the output of the following statement? System.out.printf("%.2f", 48.9);

(Multiple Choice)
4.7/5
(28)

Suppose that you have the declaration: int num = 94; double x = 73.92; String str = "Programming"; What is the output of the following statements? System.out.println("123456789012345678901234567890"); System.out.printf("%5d%6.2f %15s%n", num, x, str);

(Multiple Choice)
4.9/5
(38)

The method printf is used only to format the output of integers and decimal numbers.

(True/False)
4.7/5
(35)

The classes Integer, Float, and Double are called wrapper classes.

(True/False)
4.9/5
(27)

In a format specifier, the option width specifies the maximum number of characters to be written to the output.

(True/False)
4.7/5
(37)

The value of the expression Integer.parseInt("+782") is "782".

(True/False)
4.8/5
(38)

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

(True/False)
5.0/5
(37)

Which statement instructs a program to run the garbage collector?

(Multiple Choice)
4.7/5
(38)

Which of the following statements would store input in name?

(Multiple Choice)
4.9/5
(34)

Which of the following outputs 56734.9875 to three decimal places?

(Multiple Choice)
4.8/5
(40)

What is the value of the following statement? Math.pow(3,4)

(Multiple Choice)
4.9/5
(44)

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
(39)

In a string, the index (position) of the first character is 1.

(True/False)
4.9/5
(34)

An expression such as str.length(); is an example of a(n) ____.

(Multiple Choice)
4.8/5
(34)

In Java, all variables declared using a class are ____.

(Multiple Choice)
4.7/5
(36)

The dot (.) operator is also called the member specific operator.

(True/False)
4.8/5
(37)

Based on the code above, what is the value of str3?

(Multiple Choice)
4.9/5
(28)
Showing 1 - 20 of 50
close modal

Filters

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