Java Reference
In-Depth Information
immutable Object whose state cannot change. Specifically, String s are
immutable. (35)
input and output (I/O) Achieved through the use of the java.io package. (51)
java.io Package that is used for nontrivial I/O. (51)
length field Used to determine the size of an array. (38)
length method Used to determine the length of a string. (36)
lhs and rhs Stand for left-hand side and right-hand side, respectively. (32)
multidimensional array An array that is accessed by more than one index. (45)
new Used to construct an object. (31)
null reference The value of an object reference that does not refer to any
object. (28)
NullPointerException Generated when attempting to apply a method to a null
reference. (31)
object A nonprimitive entity. (30)
reference type Any type that is not a primitive type. (30)
runtime exception Does not have to be handled. Examples include
ArithmeticException and NullPointerException . (49)
Scanner Used for line-at-a-time input. Also used to extract lines, strings, and
primitive types from a single character source such as an input stream or
String . Found in the java.util package. (52, 53)
String A special object used to store a collection of characters. (35)
string concatenation Performed with + and += operators. (35)
System.in , System.out , and System.err The predefined I/O streams. (53)
throw clause Used to throw an exception. (51)
throws clause Indicates that a method might propagate an exception. (51)
toString method Converts a primitive type or object to a String . (37)
try block Encloses code that might generate an exception. (48)
common errors
For reference types and arrays, = does not make a copy of object values.
Instead, it copies addresses.
1.
For reference types and strings, equals should be used instead of == to test
if two objects have identical states.
2.
Off-by-one errors are common in all languages.
3.
 
Search WWH ::




Custom Search