Exam 2: Basic Elements of Java

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

The null string contains only the blank character.

(True/False)
4.8/5
(34)

____ are executable statements that inform the user what to do.

(Multiple Choice)
4.9/5
(31)

The expression (double)(5 + 4) evaluates to ____.

(Multiple Choice)
4.7/5
(29)

The value of the expression 5 + 10 % 4 - 3 is ____.

(Multiple Choice)
4.7/5
(39)

If a = 4; and b = 3;, then after the statement a = b; executes, the value of b is 4 and the value of a is 3.

(True/False)
4.8/5
(33)

The pair of characters // is used for single line comments.

(True/False)
4.8/5
(43)

Consider the following program. public class CircleArea {static Scanner console = new Scanner(System.in); static final float PI = 3.14; public static void main(String[]args) {float r; float area; r = console.nextDouble(); area = PI * r * r; System.out.println("Area = " + area);}} To successfully compile this program, which of the following import statement is required?

(Multiple Choice)
4.8/5
(40)

The number of significant digits in a double variable is up to 15.

(True/False)
4.8/5
(33)

Both System.out.println and System.out.print can be used to output a string on the standard output device.

(True/False)
4.9/5
(40)

A value such as 'd' is called a character constant.

(True/False)
4.9/5
(43)

The value of a variable may change during program execution.

(True/False)
4.8/5
(41)

Given char ch; int num; double pay; Which of the following assignment statements are valid? (i) ch = '*'; (ii) pay = num * pay; (iii) rate * 40 = pay;

(Multiple Choice)
4.8/5
(36)

The == characters are a special symbol in Java.

(True/False)
4.8/5
(42)

Which of the following is a valid Java identifier?

(Multiple Choice)
4.8/5
(39)

If ++x is used in an expression, first the expression is evaluated, and then the value of x is incremented by 1.

(True/False)
4.7/5
(33)

Suppose x = 8. After the execution of the statement y = x++; y is 8 and x is 10.

(True/False)
4.9/5
(35)

The symbol '5' does not belong to the char data type because 5 is a digit.

(True/False)
4.9/5
(34)

When a value of one data type is automatically changed to another data type, an implicit type coercion has occurred.

(True/False)
4.9/5
(43)

Suppose that alpha and beta are int variables. The statement alpha = --beta; is equivalent to the statement(s) ____.

(Multiple Choice)
4.8/5
(40)

An operator that has only one operand is called a unique operator.

(True/False)
4.9/5
(38)
Showing 21 - 40 of 50
close modal

Filters

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