Java Reference
In-Depth Information
An integer literal is treated as an int by the JVM. The literal can be
appended with an L to denote that the literal is a long. A floating-point
literal is treated as a double by the JVM. An F can be appended to the
literal to denote it as a float.
■■
String literals are treated as java.lang.String objects. A String object is
immutable, meaning that once it is instantiated, its contents cannot be
changed.
■■
A variable in Java is either one of the eight primitive data types or a
reference.
■■
The final keyword in Java is used to declare a constant.
■■
There are three ways to declare comments in Java: two forward slashes
// comment out the remainder of the current line of text; the format
/* ... */ is used to comment out multiple lines of text; the /** ... */
format is a special type of comment used by the javadoc tool.
■■
Search WWH ::




Custom Search