Challenge: Design a Contact Class
Aufgabe
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 2. Kapitel 2
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Suggested prompts:
Can you explain this in simpler terms?
What are the main takeaways from this?
Can you give me a real-world example?
Großartig!
Completion Rate verbessert auf 4.17
Challenge: Design a Contact Class
Swipe um das Menü anzuzeigen
Aufgabe
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 2. Kapitel 2
single