Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace AlgorithmsRetakeExam
- {
- public class Dog
- {
- private string name;
- private int age;
- public Dog()
- {
- }
- public Dog(string name, int age)
- {
- Name = name;
- Age = age;
- }
- public string Name
- {
- get
- {
- return name;
- }
- set
- {
- name = value;
- }
- }
- public int Age
- {
- get
- {
- return age;
- }
- set
- {
- age = value;
- }
- }
- public override string ToString()
- {
- return $"Dog {Name} is {Age} years old.";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement