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 App4a
- {
- class Human
- {
- private string name;
- private int age;
- private double temp;
- public static int counter = 0;
- public static string nationality = "Bulgarian";
- public const double PI = 3.14;
- public readonly double onlyRead = 2.7;
- public string Name
- {
- get { return name; }
- set { name = value; }
- }
- public int Age
- {
- get { return age; }
- set { age = value; }
- }
- public double Balance
- {
- get { return 2 * 2; }
- }
- public Human()
- :this("Default", 0)
- {
- // this.name = "Deafult";
- // this.age = 0;
- }
- public Human(string name, int age)
- {
- this.name = name;
- this.age = age;
- counter++;
- onlyRead = 4.5;
- }
- public Human(int age, string name)
- : this(name, age)
- {
- // this.name = name;
- // this.age = age;
- }
- public void IntroduceYourSelf()
- {
- Console.WriteLine("My name is {0}. I am {1} years old! My balance is {2}. My nationality is {3}", name, age, Balance, nationality);
- }
- public void IntroduceYourSelf(string verbous)
- {
- IntroduceYourSelf();
- Console.WriteLine("I should be more verbous!");
- // Console.WriteLine("My name is {0} and the value is contained in a field. I am {1} years old! My balance is {2}", name, age, Balance);
- }
- /*
- public string GetName()
- {
- return name;
- }
- public void SetName(string name)
- {
- this.name = name;
- }
- public int GetAge()
- {
- return age;
- }
- public void SetAge(int age)
- {
- this.age = age;
- }
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement