Intro to Java Applications Flashcards
a) A(n) ____ begins the body of every method, and a(n) ___ ends the body of every method.
a) left brace ({), right brace (}).
b)The ___ statement is used to make decisions.
b) if.
c) ___ begins an end-of-line comment.
c) //.
d)The ___ object is known as the standard output object.
d) System.out.
e) ___ are reserved for use by Java.
e) Keywords.
f)Java applications begin execution at method ___.
f) main.
g) The ___ after the identifier main indicate that it’s a program building block called a method.
g) parenthesis.
a) Comments cause the computer to print the text after the // on the screen when the program executes.
a) False. Comments do not cause any action to be performed when the program executes. They’re used to document programs and improve their readability.
b) All variables must be given a type when they’re declared.
b) True.
c) Java considers the variables number and NuMbEr to be identical.
c) False. Java is case sensitive, so these variables are distinct.
d)The remainder operator (%) can be used only with integer operands.
d) False. The remainder operator can also be used with non- integer operands in Java.
e) The arithmetic operators *, /, %, + and - all have the same level of precedence.
e) False. The operators *, / and % are higher precedence than operators + and -.