[Skip Breadcrumb Navigation]
:
[Skip Breadcrumb Navigation]
Home
Student Resources
Chapter Quizzes
Chapter 1
Chapter 1
Getting Started
This activity contains 15 questions.
"Compatibility" regarding assignment statements means:
You may assign a byte to a double variable
You may assign a short to a byte variable
You may assign a float to a short variable
You may assign a double to a long variable
"Invoking a method" is sometimes called...
"receiving a message"
"sending an object"
"sending a message"
"jumping to a subroutine"
A constant or literal is an object whose value is determined from how it is "spelled." Which of the following are valid literals?
'Z', "testing, 1, 2, 3", 8x10e5
-14.92, 'a string of letters'
5, 17.4, 'c'
true, -23.4509, "a string
Java compiles into an intermediate language called byte-code. What is byte-code?
It's the machine language for Intel-class computers
It's a collection of bytes of data
It's 8 bits of coding
It's the machine language for the Java Virtual Machine
Java was developed at Sun Microsystems by James Gosling. It was introduced to the public in what year?
1990.
1989.
1995.
1999.
System.out.println ("/* I love */ Java!"); will display:
Java!
That's not legal Java -- nothing is displayed.
/* I love */ Java!
I love Java!
The increment (++) and decrement (--) operators:
Only can be used to modify the values of variables containing integers -- like short, and it
Can be used to modify the value of a string
Can be used to modify the value of any numeric variable -- int, short, byte, float, double
Can be used to modify the value of any numeric expression
What does an "assignment statement" do?
It's much the same as an equation in algebra -- it makes a statement about the equality of the left- and right-sides of an equation
It evaluates the expression on the "right hand side" and then saves this value in the variable on the "left hand side"
It calculates a value, based on the expression that is given, and then assigns this value to the variable on the right of the equal sign
It evaluates the expression on the "left hand side" and then saves this value in the variable on the "right hand side"
What does it mean for the "preferred" type of integers to be
int
and the "preferred" type of floating point numbers to be
double
?
You should use
int
and
double
rather than
short
and
float
int
and
double
are primitive types, while other forms of integers -- like
short
-- and other forms of floating point numbers -- like
float
-- are not
If you combine different kinds of numbers, they'll all wind up becoming
int
s
and
double
s
If you don't explicitly say differently, an integer will be assumed to be an
int
, and a floating point number will be assumed to be a
double
What is a syntax error?
An error that occurs during program execution
A grammatical mistake, including misspelling, in a program
An error in computation in the source code
An error in the semantics of a program
What is the function of the Java class loader?
It loads all the classes used by a Java program
It compiles the Java source into classes
It translates the Java classes into machine language
It loads the data used by a Java program
What is the result of saying:
"abc" + 4 + 5 + "fgh"?
"abc45fgh"
"abc4fgh5"
Not a legal Java expression
"abc9fgh"
What statement is true about Java reserved words?
They are all in upper-case.
They are all in lower-case.
They can be in either upper-case or lower-case or mixed-case.
They are case-independent.
Which of the following is (are) true?
Java's rules for using parentheses and precedence are about the same as those in algebra
Java's rules for using parentheses are about the same as those in algebra; but, its precedence rules are quite different
Java's rules for precedence are about the same as those in algebra; but, its rules for using parentheses are quite different
Java's rules for using parentheses and precedence both are different from those in algebra
Only (d)
Only (b)
Only (a)
Only (c)
Which of the following statements are true?
Every variable must be declared before it can be used
Every variable must be given an initial value
Variables can be used, even if they've not been declared, so long as they have an initial value
A variable may be re-declared, if desired, but it loses its current value when this is done
Answers (a) and (d)
Only (c)
Answers (a) and (b)
Only (a)
The Submit Answers for Grading feature requires scripting to function. Your browser either does not support scripting or you have turned scripting off.
So, the Submit Answers for Grading button below will not work.
The following Submit Answers for Grading button is provided in its place and will clear your answers:
The Clear Answers and Start Over feature requires scripting to function. Your browser either does not support scripting or you have turned scripting off.
So, the Clear Answers and Start Over button below will not work.
The following Clear Answers button is provided in its place and will clear your answers:
Your browser either does not support scripting or you have turned scripting off. Because of this, the answer choices will NOT appear in a different order each time the page is loaded, though that is mentioned below. Note that you do not need this feature to use this site.
Answer choices in this exercise appear in a different order each time the page
is loaded.
Copyright © 1995 - 2010
Pearson Education
. All rights reserved. Pearson Addison Wesley is an imprint of
Pearson
.
Legal Notice
|
Privacy Policy
|
Permissions
[Return to the Top of this Page]
: [Return to the Top of this Page]