Challenge: Design a Contact Class
Tâche
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.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 2. Chapitre 2
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Suggested prompts:
Can you explain this in simpler terms?
What are the main takeaways from this?
Can you give me a real-world example?
Génial!
Completion taux amélioré à 4.17
Challenge: Design a Contact Class
Glissez pour afficher le menu
Tâche
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.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 2. Chapitre 2
single