Answers to Self-Review Exercises
-
public
.class
.new
.type, name.
default package.
instance variable.
float
,double
.double-precision.
nextDouble
.modifier.
void
.nextLine
.java.lang
.import
declaration.floating-point number.
single-precision.
%f
.primitive, reference.
-
False. By convention, method names begin with a lowercase first letter and all subsequent words in the name begin with a capital first letter.
True.
True.
True.
False. A primitive-type variable cannot be used to invoke a method—a reference to an object is required to invoke the object’s methods.
False. Such variables are called local variables and can be used only in the method in which they’re declared.
True.
False. Primitive-type instance variables are initialized ...
Get Android How to Program, 3/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.