Exam 2: Java Fundamentals

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

A(n) ________ is a dialog box that prompts the user for input.

Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
Verified

D

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

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

B

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

Free
(Multiple Choice)
4.7/5
(41)
Correct Answer:
Verified

C

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

(True/False)
4.8/5
(39)

The boolean data type may contain 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.9/5
(39)

Which of the following statements is invalid?

(Multiple Choice)
4.8/5
(29)

The ________ method is used to display a message dialog.

(Multiple Choice)
4.9/5
(38)

Unlike a console program, a program that uses JOptionPane does not automatically stop executing when the end of the main method is reached.

(True/False)
4.9/5
(39)

Variables of the boolean data type are useful for

(Multiple Choice)
4.9/5
(44)

This is a named storage location in the computer's memory.

(Multiple Choice)
4.7/5
(36)

Which of the following statements will correctly convert the data type, if x is a float and y is a double?

(Multiple Choice)
4.9/5
(41)

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

(Multiple Choice)
4.9/5
(31)

When you call one of the Scanner class's methods to read a primitive value, such as nextInt or nextDouble, and then call the nextLine method to read a string, an annoying and hard-to-find problem can occur.

(True/False)
4.7/5
(42)

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

(True/False)
4.8/5
(40)

When saving a Java source file, save it with an extension of

(Multiple Choice)
5.0/5
(35)

Programming style includes techniques for consistently putting spaces and indentation in a program so visual cues are created.

(True/False)
4.9/5
(36)

Character literals are enclosed in ________, and string literals are enclosed in ________.

(Multiple Choice)
4.8/5
(34)

What will be the displayed when the following code is executed? Final int x = 22, y = 4; Y += x; System.out.println("x = " + x + ", y = " + y);

(Multiple Choice)
4.8/5
(27)

What will be displayed after the following statements have been executed? Int x = 15, y = 20, z = 32; X += 12; Y /= 6; Z -= 14; System.out.println("x = " + x + ", y = " + y + ", z = " + z);

(Multiple Choice)
4.9/5
(42)
Showing 1 - 20 of 40
close modal

Filters

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