= mathend000# Variablen, an die genau einmal zugewiesen wird C: const (ist Attribut für Typ) Java: final (ist Attribut für Variable) Vorsicht: class C { int foo; } static void g (final C x) { x.foo ++; } Merksatz: alle Deklarationen so lokal und so konstant wie möglich! (D. h. Attribute immutable usw.) Johannes Waldmann 2014-03-31
Vorsicht:
class C { int foo; } static void g (final C x) { x.foo ++; }
Merksatz: alle Deklarationen so lokal und so konstant wie möglich!
(D. h. Attribute immutable usw.)