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 ConsoleApplication2
- { class person
- {
- public string name;
- public int age;
- public person() { name = "неизвестно"; age = 18; }
- public person(string n) { name = n; age = 18; }
- public person(string n, int a) { name = n; age = a; }
- public void GetInfo()
- {
- Console.WriteLine("Имя:{0} Возвраст: {1}",name, age);
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- person tom = new person();
- person bob = new person("bob");
- person sam = new person("sam", 25);
- tom.GetInfo();
- bob.GetInfo();
- sam.GetInfo();
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement