Exam 3: Introduction to Objects and Inputoutput
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of Java50 Questions
Exam 3: Introduction to Objects and Inputoutput50 Questions
Exam 4: Control Structures I: Selection50 Questions
Exam 5: Control Structures II: Repetition50 Questions
Exam 6: Graphical User Interface Gui and Object-Oriented Design OOD50 Questions
Exam 7: User-Defined Methods50 Questions
Exam 8: User-Defined Classes and Adts50 Questions
Exam 9: Arrays50 Questions
Exam 10: Inheritance and Polymorphism50 Questions
Exam 11: Handling Exceptions and Events50 Questions
Exam 12: Advanced Guis and Graphics49 Questions
Exam 13: Recursion50 Questions
Exam 14: Searching and Sorting50 Questions
Select questions type
Based on the code above, what is the value of length1?
Free
(Multiple Choice)
4.7/5
(34)
Correct Answer:
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:
False
String variables are reference variables.
Free
(True/False)
4.7/5
(36)
Correct Answer:
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)
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)
An expression such as str.length(); is an example of a(n) ____.
(Multiple Choice)
4.8/5
(34)
The dot (.) operator is also called the member specific operator.
(True/False)
4.8/5
(37)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)