Оценка:
Опубликованно: 09.11.2003.
Язык: Английский
Уровень: Средняя школа
Литературный список: Нет
Ссылки: Не использованы
  • Конспект 'A Summary of Classes in Java', 1.
  • Конспект 'A Summary of Classes in Java', 2.
Фрагмент работы

*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