OOP Practice 2 | Classes and Objects | JAVA

Pubblicato il: 13 aprile 2021
sul canale di: The CS Revelation
198
8

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.


In questa pagina del sito puoi guardare il video online OOP Practice 2 | Classes and Objects | JAVA della durata di ore minuti seconda in buona qualità , che l'utente ha caricato The CS Revelation 13 aprile 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 198 volte e gli è piaciuto 8 spettatori. Buona visione!