Exam 2: Java Fundamentals

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

To compile a program named First,use the following command

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

C

Given the declaration double r;,which of the following statements is invalid?

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

D

Which Scanner class method reads an int?

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

B

What is the result of the following expression? 10 + 5 * 3 - 20

(Multiple Choice)
4.9/5
(42)

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

(True/False)
4.9/5
(43)

Which of the following does not describe a valid comment in Java?

(Multiple Choice)
4.8/5
(38)

Which of the following is a valid Java statement?

(Multiple Choice)
4.9/5
(38)

What will be displayed after the following statements have been executed? final double x; X = 54.3; System.out.println("x = " + x );

(Multiple Choice)
5.0/5
(36)

This is a value that is written into the code of a program.

(Multiple Choice)
4.9/5
(42)

All Java statements end with semicolons.

(True/False)
4.8/5
(43)

Variables of the boolean data type are useful for

(Multiple Choice)
4.8/5
(39)

The ___________ is normally considered the standard output and standard input devices,and usually refer to the monitor and keyboard.

(Multiple Choice)
4.7/5
(43)

Which Scanner class method reads a String?

(Multiple Choice)
4.8/5
(42)

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

Which of the following is valid?

(Multiple Choice)
4.8/5
(32)

Although the dollar sign is a legal identifier character,you should not use it because it is normally used for special purposes.

(True/False)
4.9/5
(34)

In Java the variable named one is the same as the variable named One.

(True/False)
4.7/5
(43)

What 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
(38)

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

(Multiple Choice)
4.8/5
(39)

What will be displayed as a result of executing the following code? int x = 6; String msg = "I am enjoying this class."; String msg1 = msg.toUpperCase(); String msg2 = msg.toLowerCase(); Char ltr = msg.charAt(x); Int strSize = msg.length(); System.out.println(msg); System.out.println(msg1); System.out.println(msg2); System.out.println("Character at index x = " + Ltr); System.out.println("msg has " + strSize + "characters.");

(Multiple Choice)
4.9/5
(46)
Showing 1 - 20 of 53
close modal

Filters

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