For Chapter 2
THIS PAGE CONTAINS A SAMPLE quiz on material from
Chapter 2 of this on-line
Java textbook. You should be able to answer these questions after
studying that chapter. Sample answers to all the quiz questions can
be found here.
Briefly explain what is meant by the syntax and the semantics of
a programming language. Give an example to illustrate the difference between a
syntax error and a semantics error.
What does the computer do when it executes a variable declaration statement.
Give an example.
What is a type, as this term relates to programming?
One of the primitive types in Java is boolean. What is the boolean type?
Where are boolean values used? What are its possible values?
Give the meaning of each of the following Java operators:
Explain what is meant by an assignment statement, and give an
example. What are assignment statements used for?
What is meant by precedence of operators?
What is a literal?
In Java, classes have two fundamentally different purposes. What are they?
What is the difference between the statement
"x = TextIO.getDouble();" and the statement "x = TextIO.getlnDouble();"
| Chapter Index
| Main Index