Java Reference
In-Depth Information
4.
There are two types of import statements: specific import and wildcard import . The
specific import specifies a single class in the import statement; the wildcard import
imports all the classes in a package.
5.
In Java, the equal sign ( = ) is used as the assignment operator.
6.
A variable declared in a method must be assigned a value before it can be used.
7.
A named constant (or simply a constant ) represents permanent data that never changes.
8.
A named constant is declared by using the keyword final .
9.
Java provides four integer types ( byte , short , int , and long ) that represent integers
of four different sizes.
10.
Java provides two floating-point types ( float and double ) that represent floating-
point numbers of two different precisions.
11.
Java provides operators that perform numeric operations: + (addition), - (subtraction),
* (multiplication), / (division), and % (remainder).
12. Integer arithmetic ( / ) yields an integer result.
13. The numeric operators in a Java expression are applied the same way as in an arithmetic
expression.
14. Java provides the augmented assignment operators += (addition assignment), -= (sub-
traction assignment), *= (multiplication assignment), /= (division assignment), and %=
(remainder assignment).
15.
The increment operator ( ++ ) and the decrement operator ( -- ) increment or decrement
a variable by 1 .
16.
When evaluating an expression with values of mixed types, Java automatically converts
the operands to appropriate types.
17.
You can explicitly convert a value from one type to another using the (type)value
notation.
18.
Casting a variable of a type with a small range to a variable of a type with a larger range
is known as widening a type.
19.
Casting a variable of a type with a large range to a variable of a type with a smaller range
is known as narrowing a type.
20.
Widening a type can be performed automatically without explicit casting. Narrowing a
type must be performed explicitly.
21.
In computer science, midnight of January 1, 1970, is known as the UNIX epoch.
Q UIZ
Answer the quiz for this chapter online at www.cs.armstrong.edu/liang/intro10e/quiz.html .
 
 
Search WWH ::




Custom Search