Vērtējums:
Publicēts: 09.11.2003.
Valoda: Angļu
Līmenis: Vidusskolas
Literatūras saraksts: Nav
Atsauces: Nav
  • Konspekts 'A Summary of Classes in Java', 1.
  • Konspekts 'A Summary of Classes in Java', 2.
Darba fragmentsAizvērt

*Instance data is the declaration of variables.
*This instance data has private visibility because you don't want clients to change it.
*Constructors initialize instance data. In this case, the instance data is the object myColor.
*A constructor with no parameters is called the default constructor.
*Default constructors select default values to use to initialize the instance data.
*Other constructors use values passes through parameters to initialize instance data.
*Notice that these constructors have the same name as the class and have no return value.
*These constructors provide an example of overloaded methods. Remember that overloaded methods are two methods with the same name and different method signatures.

Atlants