PrintWriter correct answers What is used for writing output to a file?
scanner correct answers What is used when getting input from a file?
scanner correct answers Which of the following is not a primitive data type?
float
long
Scanner
char
/n correct answers Which of the following is an example of an escape sequence?
/n
while
main
Scanner
count == 1 correct answers Which of the following does not change the value of a
variable?
count++
count == 1
count += 1
count = 1
count = count + 1
Math.pow correct answers Which of the following should you use to compute the value
that results when raising one variable to the power of another (i.e, exponentiation)?
Math.pow
Math.random
**
++
^
none
ok will always be printed correct answers if( firstletter != 'y' || firstletter != 'Y')
System.out.println ( "ok" );
Which of the following true:
ok will always be printed
ok will never be printed
ok will be printed only when firstletter is neither 'y' nor 'Y'
the value of firstletter will be printed only if it has the value 'n'
none
, TestQuestion.java correct answers Suppose you implement a class with the header
// public class TestQuestion
The java source code for the class is stored in a file with the name:
19 correct answers How many times will the body of the loop execute?
for (int i = 1; i < 20, i++)
{
System.out.println ( i )
}
While correct answers What should you typically use if you want to continue asking the
user to enter a value whenever they type a invalid input?
Accumulating correct answers This term us used to describe variables that keep a
running total of something.
Variable correct answers A(n) _____ is a named storage location in a computer's
memory.
/* correct answers This marks the beginning of a multiline comment.
Literal correct answers A(n) ______ is a value like 'A' or 72 that is written into the code
of a program.
Narrowing Conversion correct answers A(n) _______ is a kind of type conversion which
causes an error because information may be lost.
Nested Loop correct answers This term describes a loop that appears inside another
loop.
Final correct answers This is a keyword used when declaring a variable which cannot
be changed.
A declaration opens up a space for a value in the computer's memory and an
assignment fills it with a value.
Declaration: Int Example;
Assignment: Example = #; correct answers What is the difference between a declaration
and an assignment? Give examples.
When your Java class doesn't have the right data type for what you need. correct
answers When is the use of a cast operation necessary?
= is a Simple assignment operator while == is Equal to. correct answers Explain how =
is different than ==.