Question: QUESTION 1 What ( if anything ) is the output of the following code: System.out.println ( Hello , Dave. How have you been? )
QUESTION
What if anything is the output of the following code:
System.out.printlnHello
Dave. How have you been?";
Hello,
Dave. How have you been?
Hello,
Dave. How have you been?
Hello, Dave. How have you been?
It will not output anything as there is a syntax error that will produce a compiler bug.
points
QUESTION
Which of the following is not a valid example of a variable declaration and assignment:
int x y ;
double price price;
int x ;
char cx;
points
QUESTION
What will be the output of the following code:
System.out.printlnWe went to the movie.
It was very fun.
However, I would have preferred to go bowling instead.";
We went to the movie. It was very fun. However, I would have preffered to go bowling instead.
We went to the movie.
It was very fun.
However, I would have prefferred to go bowling instead.
We went to the movie.
It was very fun.
However, I would have prefferred to go bowling instead.
It will not output anything as it will generate a compiler error.
points
QUESTION
What select all correct answers is wrong with the following code:
final double PI ;
int x ;
boolean isSafe false;
PI ;
double area PI ;
y x;
One of the variables has been declared more than once.
One of the statements attempts to modify a constant.
One of the variables contains an illegal identifier.
One of the variables has not been declared.
Nothing is wrong with the code example.
One of the variable is assigned the wrong type of data when it is initialized.
points
QUESTION
Which of the following is not a valid variable declaration and initialization:
char firstLetter a;
long bigNumber L;
double PRICE ;
boolean isTrue ;
points
QUESTION
If you wanted to produce the following output, which select all correct answers of the following code examples would work:
Hello
World!
System.out.printlnHello;
System.out.printlnWorld;
System.out.printlnHello
World!";
System.out.printlnHello
World!";
String s "Hello", s"World!", s
;
System.out.printlns s s;
String s "Hello";
String s "World";
System.out.printlns s;
points
QUESTION
Which of the following is the correct way to declare a constant variable:
final double radiusOfTire ;
final PI ;
contant double RADIUSOFTIRE ;
double PI ;
points
QUESTION
What if anything is wrong with the following code:
int xPosition, yPosition;
xPosition ;
yPosition ;
int xPosition yPosition;
The variable yPosition is being assigned a value of the incorrect type.
Nothing is wrong with this code.
The variable xPosition is being declared twice.
Multiple variables cannot be declared on the same line.
Variables of the type int cannot be assigned a literal value.
points
QUESTION
What if anything will be the output of the following code:
System.out.printlnMy friend Bill said, "I really love ice cream!"";
My friend Bill said, "I really love ice cream!"
My friend Bill said, "I really love ice cream!""
My friend Bill said,
"I really love ice cream!"
It will not output anything as it contains a syntax error and will cause a compiler error.
points
QUESTION
Which select all correct answers of the following Java statements are valid:
final String MESSAGE "I said, Go away!"";
final char c c;
final double PI ;
final int students;
points
QUESTION
The boolean data type can only store one of two different values, which are the Java reserved words true and false.
True
False
points
QUESTION
In Java was use a single equalsign, to assign a value to a variable.
True
False
points
QUESTION
Java's integer data type is unsigned, which means it can only store positive values.
True
False
points
QUESTION
The char data type is capable of storing multiple Unicode characters.
True
False
points
QUESTION
Among other uses, the plussign is the String concatenation operator which can be used to combine multiple String variables or String literals into a single String.
True
False
points
QUESTION
In Java, variable assignment is left to right. That is the variable on the right will receive the value of the variable or literal value on the left.
True
False
points
QUESTION
The following piece of code is a valid declaration and initialization:
long populationOfEarth ;
True
False
points
QUESTION
To declare a variable as constant, it is necessary to use the Java reserved word constant.
True
False
points
QUESTION
To create a String that contains special characters such as a newline, a tab, or quotation marks it is necessary to use an escape sequence.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
