java.awt.Color
, java.math.BigDecimal
, java.lang.String
.
final
keyword.
const T *
vs. T * const
in C++.
class fraction() public final long numerator, denominator
System.out.println(f.numerator)
f.numerator = 3
f.numerator
is final.
class name() public final String firstName, lastName
System.out.println(n.firstName)
n.firstName[0] = toUpper(n.firstName[0])
String
s are immutable.
class roster() public final Student classRoster[]
System.out.println(cs598.classRoster[0])
cs598.classRoster[0] = null
The array reference is unchanging; the array is not.
Neither are the array elements.
this
during initialization.
equal()
and HashCode()
contracts.
equal()
is the same as ==
.
f(g(), h())
or i = f() + g()
String replace( String str, String old, String new) int i = find(str, old) return str[0..i] + new + str[i+old.length()-1..str.length()]
String
vs. StringBuffer
.
final
.
T * const
vs. const T *
.
This page last modified on 30 July 2002.