Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

A. Introduction to Java Applications > Answers to Self-Review Exercises

Answers to Self-Review Exercises

A.1

a. left brace ({), right brace (}).

b. if.

c. //.

d. Space characters, newlines and tabs.

e. Keywords.

f. main.

g. System.out.print, System.out.println and System.out.printf.

A.2

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. True.

c. False. Java is case sensitive, so these variables are distinct.

d. False. The remainder operator can also be used with non-integer operands in Java.

e. False. The operators *, / and % are higher precedence than operators + and -.

A.3

a. int c, thisIsAVariable, q76354, number;

or

int c;
int thisIsAVariable;
int q76354;
int number;

b. System.out.print( "Enter an integer: "


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint