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