Exam 3: Introduction to Objects and Input/output

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

Consider the following statements.double x; String y;y = String.format("%.2f", x);If x = 285.679, what is the value of y?

(Multiple Choice)
4.9/5
(40)

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

(True/False)
4.8/5
(37)

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 str3?

(Multiple Choice)
4.7/5
(43)

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

(Multiple Choice)
4.9/5
(40)

Java provides automatic garbage collection.

(True/False)
4.8/5
(38)

Which package is automatically imported by the Java system?

(Multiple Choice)
4.8/5
(34)

String variables are reference variables.

(True/False)
4.8/5
(28)

Which of the following is an area of secondary storage used to hold information?

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

Which of the following method is contained in the package java.util?

(Multiple Choice)
4.9/5
(43)
Showing 41 - 50 of 50
close modal

Filters

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