Challenge: Design a Contact Class
Tehtävä
Swipe to start coding
Create a Contact class to represent a person's contact information for an address book application.
- The
Contactclass must have three private fields:name,phone, andemail. - You must implement a constructor that takes three parameters (name, phone, email) and assigns them to the corresponding private fields.
- Implement a public method named
GetNamethat returns the value of thenamefield. - Implement a public method named
GetPhonethat returns the value of thephonefield. - Implement a public method named
GetEmailthat returns the value of theemailfield.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 2. Luku 2
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 4.17
Challenge: Design a Contact Class
Pyyhkäise näyttääksesi valikon
Tehtävä
Swipe to start coding
Create a Contact class to represent a person's contact information for an address book application.
- The
Contactclass must have three private fields:name,phone, andemail. - You must implement a constructor that takes three parameters (name, phone, email) and assigns them to the corresponding private fields.
- Implement a public method named
GetNamethat returns the value of thenamefield. - Implement a public method named
GetPhonethat returns the value of thephonefield. - Implement a public method named
GetEmailthat returns the value of theemailfield.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 2. Luku 2
single