Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Design a Contact Class | Class Design and Encapsulation
C# OOP Class Construction Drills

bookChallenge: Design a Contact Class

Завдання

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.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 2
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

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

Свайпніть щоб показати меню

Завдання

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.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 2
single

single

some-alt