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 ConsoleApp2
- {
- public class Person
- {
- public int age;
- public string name;
- public void GetInfo()
- {
- Console.WriteLine("Имя: {0}, Возраст: {1}", name, age);
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Person tom = new Person();
- tom.GetInfo();
- tom.name = "Tom";
- tom.age = 34;
- tom.GetInfo();
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement