Exam 2: Basic Elements of Java
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
An identifier can be any sequence of characters and integers.
Free
(True/False)
4.9/5
(41)
Correct Answer:
False
In Java, a period is used to terminate a statement.
Free
(True/False)
4.9/5
(37)
Correct Answer:
False
Consider the following program. // Insertion Point 1 public class CircleArea {// Insertion Point 2 static final float PI = 3.14 public static void main(String[]args) {//Insertion Point 3 float r = 2.0; float area; area = PI * r * r; System.out.println("Area = " + area);} // Insertion Point 4} In the above code, where do the import statements belong?
Free
(Multiple Choice)
5.0/5
(32)
Correct Answer:
A
Suppose that index is an int variable. The statement index = index + 1; is equivalent to index++;
(True/False)
4.9/5
(37)
Suppose x = 18.6. The output of the statement System.out.println((int)(x) / 3); is 6.
(True/False)
4.9/5
(34)
What is the output of the following statement? System.out.println("Welcome \n Home");
(Multiple Choice)
4.8/5
(35)
When evaluating a mixed expression, all integer operands are converted to floating-point numbers with the decimal part of zero.
(True/False)
4.8/5
(36)
Suppose console is a Scanner object initialized with the standard input device. The expression console.nextInt(); is used to read one int value and the expression console.nextDouble(); is used to read two int values.
(True/False)
4.9/5
(32)
Which of the following statements about a named constant is NOT true?
(Multiple Choice)
4.8/5
(36)
Suppose x = 4 and y = 2. If the statement x *= y; is executed once, what is the value of x?
(Multiple Choice)
4.9/5
(42)
Suppose console is a Scanner object initialized with the standard input device and feet and inches are int variables. Consider the following statements: feet = console.nextInt(); inches = console.nextInt(); These statements require the value of feet and inches to be input on separate lines.
(True/False)
4.8/5
(30)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)