Exam 2: Java Fundamentals

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

Assuming that pay has been declared a double,the following statement is valid. pay = 2,583.44;

(True/False)
4.8/5
(37)

What will be the value of z after the following statements have been executed? int x = 4,y = 33; Double z; Z = (double)(y / x);

(Multiple Choice)
5.0/5
(31)

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

In the following Java statement what value is stored in the variable name? String name = "John Doe";

(Multiple Choice)
4.9/5
(42)

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

(Multiple Choice)
4.8/5
(33)

Which of the following is not a valid comment statement?

(Multiple Choice)
4.7/5
(28)

If the compiler encounters a statement that uses a variable before the variable is declared,an error will result.

(True/False)
4.9/5
(31)

Every Java application program must have

(Multiple Choice)
4.7/5
(41)

Character literals are enclosed in _____;string literals are enclosed in _____.

(Multiple Choice)
4.8/5
(42)

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

(Multiple Choice)
4.8/5
(35)

A Java program must have at least one of these:

(Multiple Choice)
4.8/5
(29)

What would be displayed as a result of the following code? int x = 578; System.out.print("There are " + X + 5 + " \ n" + "hens in the hen house.");

(Multiple Choice)
4.8/5
(34)

What will be displayed as a result of executing the following code? int x = 8; String msg = "I am enjoying java."; 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.8/5
(34)

If the following Java statements are executed,what will be displayed? System.out.println("The top three winners are \ n"); System.out.print("Jody,the Giant \ n"); System.out.print("Buffy,the Barbarian"); System.out.println("Adelle,the Alligator");

(Multiple Choice)
4.7/5
(46)

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

(Multiple Choice)
4.8/5
(49)

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

(Multiple Choice)
4.8/5
(36)

What will be the value of z as a result of executing the following code? int x = 5,y = 28; Float z; Z = (float)(y / x);

(Multiple Choice)
4.7/5
(40)

To print "Hello,world" on the monitor,use the following Java statement

(Multiple Choice)
4.9/5
(31)

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

(True/False)
4.8/5
(43)

What is the result of the following expression? 25 / 4 + 4 * 10 % 3

(Multiple Choice)
4.8/5
(37)
Showing 21 - 40 of 53
close modal

Filters

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