Java Reference
In-Depth Information
5 . Which of the following variable names is invalid?
The invalid variable is D . Variable names cannot begin with a digit.
6 . How do you create a single-line comment? How do you create a multiline comment?
A single-line comment begins with // and ends at the end of the line. A multiline
comment begins with /* and ends with */ .
7 . Show the general form of the if statement. Show the general form of the for loop.
The general form of the if :
if (condition) statement;
The general form of the for :
for (initialization; condition; iteration) statement;
8 . How do you create a block of code?
A block of code is started with a { and ended with a } .
9 . The moon's gravity is about 17 percent that of the earth's. Write a program that com-
putes your effective weight on the moon.
Search WWH ::




Custom Search