Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
25 Cards in this Set
- Front
- Back
Variables are |
XSymbolic names made up by the programmer that represents locations in the computer'sRAM
Reserved words Symbolic names made up by the programmer whose values cannot be changed Operators that perform operations on one or more operands |
|
Suppose you are at an operating system command line, and you are going to use the following command to compile a program: |
Save the program with the .comp extension Execute the java.sun.com program Correct! Make sure you are in the same directory or folder where the MyClass.java file is located Close all other Windows on your computer system |
|
This is a software entity that contains data and procedures.
|
Object |
|
Because Java byte code is the same on all computers, compiled Java programs |
Are Highly Portable |
|
Which of the following commands will compile a program named ReadIt? |
java ReadIt.java
java ReadIt.javac Correct! javac ReadIt.java javac ReadIt.javac |
|
Which of the following will run the compiled program ReadIt? |
java ReadIt |
|
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 |
|
What would be printed out as a result of the following code?
|
Nothing. This is an error. |
|
Which of the following is not a rule that must be followed when naming identifiers? |
The first character must be one of the letters a-z, A-Z, and underscore or a dollar sign.
Correct! Identifiers can contain spaces. Uppercase and lowercase characters are distinct. After the first character, you may use the letters a-z, A-Z, the underscore, a dollar sign, or digits 0-9. |
|
Which of the following is not a primitive data type? |
short
long float Correct! String |
|
The boolean data type may contain values in the following range of values |
true or false
-128 to +127 -2,147,483,648 to +2,147,483,647 -32,768 to +32,767 |
|
What is the result of the following statement?25/4 + 4 * 10 % 3 |
19 You Answered 5.25 3 Correct Answer 7 |
|
What will be displayed as a result of executing the following code? |
x = 32, y = 4
x = 9, y = 52 Correct! x = 37, y = 5 x = 160, y = 80 |
|
What will be the displayed when the following code is executed? |
x = 22, y = 4
You Answered x = 22, y = 26 x = 22, y = 88 Correct Answer Nothing, this is an error |
|
In the following Java statement what value is stored in the variable name?String name = "John Doe"; |
"John Doe"
Correct! The memory address where "John Doe" is located "name" The memory address where name is located |
|
To print "Hello, world" on the monitor, use the following Java statement |
SystemOutPrintln("Hello, world");
System.out.println{"Hello, world"}-Correct! System.out.println("Hello, world"); Print("Hello, world"); |
|
To display the output on the next line, you can use the println method or use this escape sequence in the print method.
|
\n (Ans)
\r \t \b |
|
Which of the following expressions will determine whether x is less than or equal to y? |
x > y
x =< y Correct! x <= y x >= y |
|
What will be the value of ans after the following code has been executed? |
10 145 Correct! 20 No value, there is a syntax error |
|
If chr is a char variable, which of the following if statements is written correctly? |
if (char == 'a')
|
|
What will be the values of ans, x, and y after the following statements are executed? |
ans = 60, x = 50, y =100
Correct! ans = 60, x = 0, y = 50 ans = 45, x = 50, y = 0 ans = 45, x = 50, y = 50 |
|
What will be the value of bonus after the following code is executed?
|
200 500 1000(Ans) 1250 |
|
f str1 and str2 are both Strings, which of the following will correctly test to determine whether str1 is less than str2?
|
1, 2, and 3 will all work
2 Correct Answer 3 You Answered 2 and 3 |
|
What would be the value of x after the following statements were executed?
|
5 20 (Ans) 25 30 |
|
What is the value of x after the following code has been executed?
|
75 90 15 165 (Ans) |