Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MyLib
- {
- public class Person
- {
- private int age=34;
- public int Age
- {
- get
- {
- return age;
- }
- }
- public string name;
- public void GetInfo()
- {
- Console.WriteLine("Возраст {0} Имя {1}", age, name);
- }
- }
- }
- using System;
- using MyLib;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- Person tom = new Person();
- tom.GetInfo();
- tom.name = "Tom";
- int age=tom.Age;
- tom.GetInfo();
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement