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