Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ООП
- {
- class Program
- {
- static void Main(string[] args)
- {
- User user1 = new User();
- User user2 = new User();
- Console.WriteLine(user1.Id);
- Console.WriteLine(user2.Id);
- }
- }
- class User
- {
- public static int Ids;
- public int Id;
- public User()
- {
- Id = ++Ids;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement