Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 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 ConsoleApp2
  8. {
  9. public class Person
  10. {
  11. public int age;
  12. public string name;
  13. public void GetInfo()
  14. {
  15. Console.WriteLine("Имя: {0}, Возраст: {1}", name, age);
  16. }
  17. }
  18. class Program
  19. {
  20. static void Main(string[] args)
  21. {
  22. Person tom = new Person();
  23. tom.GetInfo();
  24. tom.name = "Tom";
  25. tom.age = 34;
  26. tom.GetInfo();
  27. Console.ReadKey();
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement