Exam 3: Introduction to Objects and Input/output
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of Java50 Questions
Exam 3: Introduction to Objects and Input/output50 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 Classes50 Questions
Exam 9: Arrays46 Questions
Exam 10: Inheritance and Polymorphism50 Questions
Exam 11: Handling Exceptions and Events50 Questions
Exam 12: Advanced Guis and Graphics48 Questions
Exam 13: Recursion50 Questions
Exam 14: Applications of Arrays Searching and Sorting and Strings50 Questions
Select questions type
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:
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:
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:
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)
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)