Exam 2: Data and Expressions
Exam 1: Introduction40 Questions
Exam 2: Data and Expressions40 Questions
Exam 3: Using Classes and Objects40 Questions
Exam 4: Conditionals and Loops40 Questions
Exam 5: Writing Classes40 Questions
Exam 6: Graphical User Interfaces40 Questions
Exam 7: Arrays40 Questions
Exam 8: Inheritance40 Questions
Exam 9: Polymorphism39 Questions
Exam 11: Recursion40 Questions
Exam 10: Exceptions40 Questions
Exam 12: Searching and Sorting40 Questions
Exam 13: Trees40 Questions
Exam 14: Introduction to Collections and Stacks40 Questions
Exam 15: Heaps and Priority Queues40 Questions
Exam 16: Graphs40 Questions
Select questions type
The print and the println methods are identical and can be used interchangeably.
(True/False)
4.8/5
(50)
Consider the expression: result = 15 % 4;
What value stored in result after this line is executed?
(Multiple Choice)
4.7/5
(49)
Promotion is a widening data conversion that is explicitly requested by the programmer.
(True/False)
4.8/5
(36)
Variables declared with the final modifier cannot have new values assigned to them.
(True/False)
4.8/5
(39)
Write an application that prints out the following using a single call to the print method.
Hello!
How
are you?
(Essay)
4.7/5
(42)
Which of the following is not an arithmetic operation in Java?
(Multiple Choice)
4.9/5
(34)
Consider the following snippet of code: System.out.println("30 plus 25 is " + 30 + 25);
What is printed by this line?
(Multiple Choice)
4.7/5
(34)
The byte type can be assigned a larger range of numbers than the int type.
(True/False)
4.8/5
(36)
In order to make a variable a constant which modifier must be included in its declaration?
(Multiple Choice)
4.8/5
(37)
Write a single line of Java code that computes the average of three integer variables - num1, num2, and num3 - and stores the result in a variable of type double called result.
(Essay)
4.7/5
(36)
What are some reasons that you might want to declare a variable as final?
(Essay)
4.9/5
(41)
Write a short application that computes the perimeter of a rectangle. It should allow the user to input the length and width of the rectangle as a double.
(Essay)
4.9/5
(34)
Consider the following snippet of code:
What values are stored in firstNum, secondNum and thirdNum after these lines are executed? Explain your answer.

(Essay)
4.9/5
(45)
For the following expression, indicate the order that in which the operators will be evaluated.
a + b * c / (d -
e)
(Short Answer)
4.8/5
(39)
Java has two basic kinds of numeric values: _____________, which have no fractional part, and ___________________ which do.
(Multiple Choice)
4.7/5
(27)
Consider the following snippet of code.
int iResult;
What values are stored in iResult, rResult and fResult? Explain your answers.

(Essay)
4.9/5
(44)
Which of the following is an example of an invalid expression in Java?
(Multiple Choice)
4.7/5
(34)
Showing 21 - 40 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)