Guest User

Untitled

a guest
Apr 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class valami
  9.     {
  10.         public static Random rand = new Random();
  11.  
  12.         public int age;
  13.  
  14.         public valami()
  15.         {
  16.             this.age = rand.Next(1, 100);
  17.         }
  18.     }
  19.    
  20.     class Program
  21.     {
  22.         static void Main(string[] args)
  23.         {
  24.             valami elso = new valami();
  25.             Console.WriteLine(elso.age);
  26.             valami masodik = new valami();
  27.             Console.WriteLine(masodik.age);
  28.         }
  29.     }
  30. }
Add Comment
Please, Sign In to add comment