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");
====
The top three winners are
Jody, the Giant
Buffy, the BarbarianAdelle, the Alligator
Variables are classified according to their ________.
==data type
Which of the following statements correctly creates a Scanner object for keyboard input?
===Scanner keyboard = new Scanner(System.in);
Which of the following is a valid Java statement?
Possible Answers
==String str = "John Doe";
A variable's scope is the part of the program that has access to the variable.
==true
Which of the following is not a rule that must be followed when naming identifiers?
===Identifiers can contain spaces.
Character literals are enclosed in ________; string literals are enclosed in ________.
==single quotes; double quotes
Every Java application program must have
==a method named main
The boolean data type may contain values in the following range of values
==true or false
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.");
===Nothing. This is an error.
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);
===8.0
What is the result of the following statement?
25/4 + 4 * 10 % 3
==7
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);
===5.0
Variables of the boolean data type are useful for
===Evaluating true/false conditions
This is a variable whose content is read only and cannot be changed during the program's execution of the program
===Named constant
This is normally considered the standard output and standard input devices, and usually refer to the monitor and keyboard.
==console
A Java program must have at least one
==Class definition
Given the declaration double r;, which of the following statements is invalid?
==r = 2.9X106;
If the compiler encounters a statement that uses a variable before the variable is declared, an error will result
==true
What is the result of the following expression?
25 - 7 * 3 + 12/3
==8
What is the result of the following statement?
25/4 + 4 * 10 % 3
==7
The primitive data types only allow a(n) ________ to hold a single value.
==variable
No comments:
Post a Comment