Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DefiningClasses
- {
- public class Person
- {
- private string name;
- private int age;
- public Person()
- {
- Name = "No name";
- Age = 1;
- }
- public Person(int age)
- {
- Name = "No name";
- Age = age;
- }
- public Person(string name, int age)
- {
- this.name = name;
- this.age = age;
- }
- public string Name
- {
- get { return name; }
- set { name = value; }
- }
- public int Age
- {
- get { return age; }
- set { age = value; }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement