Exam 2: Java Fundamentals

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

What output will be displayed as a result of executing the following code? int x = 5, y = 20; X += 32; Y /= 4; System.out.println("x = " + x + ", y = " + y);

(Multiple Choice)
4.8/5
(32)

Both character and string literals can be assigned to a char variable.

(True/False)
5.0/5
(42)

Which of the following cannot be used as identifiers in Java?

(Multiple Choice)
4.9/5
(44)

A Java program will not compile unless it contains the correct line numbers.

(True/False)
4.8/5
(50)

Class names and key words are examples of variables.

(True/False)
4.9/5
(42)

The System.out.printf method allows you to format output in a variety of ways.

(True/False)
4.8/5
(36)

What is the result of the following expression? 17 % 3 * 2 - 12 + 15

(Multiple Choice)
4.8/5
(40)

What would be printed out as a result of the following code? System.out.println("The quick brown fox" + "jumped over the \n" "slow moving hen.");

(Multiple Choice)
4.8/5
(33)

The primitive data types only allow a(n) __________ to hold a single value.

(Multiple Choice)
4.9/5
(40)

The boolean data type may contain which of the following range of values?

(Multiple Choice)
4.9/5
(35)

Named constants are initialized with a value and that value cannot change during the execution of the program.

(True/False)
4.8/5
(35)

Which of the following statements correctly creates a Scanner object for keyboard input?

(Multiple Choice)
4.8/5
(27)

The Java API provides a class named Math that contains numerous methods which are useful for performing complex mathematical operations.

(True/False)
4.8/5
(40)

When the + operator is used with strings, it is known as the

(Multiple Choice)
4.8/5
(37)

Which of the following is not a rule that must be followed when naming identifiers?

(Multiple Choice)
4.8/5
(37)

What is the value of z after the following code is executed? int x = 5, y = 28; Float z; Z = (float) (y / x);

(Multiple Choice)
4.8/5
(45)

If x has been declared an int, which of the following statements is invalid?

(Multiple Choice)
4.9/5
(38)

Which of the following is not a valid Java comment?

(Multiple Choice)
4.8/5
(37)

What will be displayed as a result of executing the following code? public class test { Public static void main(String[ ] args) { Int value1 = 9; System.out.println(value1); Int value2 = 45; System.out.println(value2); System.out.println(value3); Value = 16; } }

(Multiple Choice)
4.8/5
(34)

Character literals are enclosed in __________ and string literals are enclosed in __________.

(Multiple Choice)
4.8/5
(31)
Showing 21 - 40 of 52
close modal

Filters

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