OOP Practice 2 | Classes and Objects | JAVA

preview_player
Показать описание
Write a complete class named Crab that includes a String property named myColor and an int property named myAge.

You must also include a default constructor that initializes myColor to RED and myAge to zero as well as an “other” constructor that accepts two parameters and uses them appropriately.

You must also implement the getAge and setAge methods.

Next

- Construct a Crab CB1 object using default constructor and invoke all accessible methods.
- Construct a second Crab object CB2 using parameterized constructor and invoke all accessible methods.
- Describe the outcome.
Рекомендации по теме
Комментарии
Автор

This is so awesome! Lets make dat money.

JoshuaHarper
join shbcf.ru