Exam 2: Basic Elements of Java

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

The == characters are a special symbol in Java.

Free
(True/False)
4.9/5
(40)
Correct Answer:
Verified

True

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

Free
(True/False)
4.7/5
(42)
Correct Answer:
Verified

True

The declaration int a, b, c; is equivalent to which of the following?

Free
(Multiple Choice)
4.8/5
(35)
Correct Answer:
Verified

B

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
(29)

Operators of the same precedence are evaluated from right to left.

(True/False)
4.8/5
(44)

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.7/5
(39)

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

(Multiple Choice)
4.7/5
(28)

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

(True/False)
4.7/5
(34)

The length of the string "first java program" is:

(Multiple Choice)
4.8/5
(35)

The data type float is a floating-point data type.

(True/False)
4.8/5
(42)

Which of the following is a valid Java identifier?

(Multiple Choice)
4.9/5
(37)

Suppose that index is an int variable. The statement index = index + 1; is equivalent to index++;

(True/False)
4.7/5
(36)

An identifier can be any sequence of characters and integers.

(True/False)
4.8/5
(42)

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

(True/False)
4.8/5
(36)

Operators that have two operands are called ____.

(Multiple Choice)
4.8/5
(37)

The null string contains only the blank character.

(True/False)
4.9/5
(39)

Which of the following is the newline character?

(Multiple Choice)
4.9/5
(31)

In Java, a period is used to terminate a statement.

(True/False)
4.7/5
(40)

What is the output of the following statement? System.out.println("Welcome \n Home");

(Short Answer)
4.8/5
(34)

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

(True/False)
4.7/5
(43)
Showing 1 - 20 of 50
close modal

Filters

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