Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Design a Contact Class | Class Design and Encapsulation
C# OOP Class Construction Drills

bookChallenge: Design a Contact Class

Tarea

Swipe to start coding

Create a Contact class to represent a person's contact information for an address book application.

  • The Contact class must have three private fields: name, phone, and email.
  • 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 GetName that returns the value of the name field.
  • Implement a public method named GetPhone that returns the value of the phone field.
  • Implement a public method named GetEmail that returns the value of the email field.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 2
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you explain this in simpler terms?

What are the main takeaways from this?

Can you give me a real-world example?

close

bookChallenge: Design a Contact Class

Desliza para mostrar el menú

Tarea

Swipe to start coding

Create a Contact class to represent a person's contact information for an address book application.

  • The Contact class must have three private fields: name, phone, and email.
  • 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 GetName that returns the value of the name field.
  • Implement a public method named GetPhone that returns the value of the phone field.
  • Implement a public method named GetEmail that returns the value of the email field.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 2
single

single

some-alt