wingman007

OOPClassesObjectsperson

Mar 16th, 2016
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace World1b
  8. {
  9.     class Person
  10.     {
  11.         private string name;
  12.  
  13.         // private string _sdhgfshfg;
  14.  
  15.         private int age;
  16.  
  17.         private int temp;
  18.  
  19.         public string Name
  20.         {
  21.             get { return name; }
  22.             set { name = value; }
  23.         }
  24.  
  25.         public int Age
  26.         {
  27.             get { return age; }
  28.             set { age = value; }
  29.         }
  30.  
  31.         public Person(string name, int age)
  32.         {
  33.             // this.name = name;
  34.             Name = name;
  35.             Age = age;
  36.         }
  37.  
  38.         // public string Name { get; set; }
  39.  
  40.  /*
  41.         public string GetName()
  42.         {
  43.             return name;
  44.         }
  45.  
  46.         public void SetName(string name)
  47.         {
  48.             this.name = name;
  49.         }
  50.  
  51.         public int GetAge()
  52.         {
  53.             return age;
  54.         }
  55.         public void SetAge(int age)
  56.         {
  57.             this.age = age;
  58.         }
  59.  
  60.         public double GetBalance()
  61.         {
  62.             return age * 34;
  63.         }
  64. */
  65.  
  66.     }
  67. }
Add Comment
Please, Sign In to add comment