SHARE
TWEET

1203orokles01

waldorick Dec 3rd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace orokles
  4. {
  5.     class Program
  6.     {
  7.         class A
  8.         {
  9.             protected int a;
  10.             public A(): this(0) { }
  11.             public A(int a) { this.a = a; }
  12.             public void Megjelenit() { Kiir(); }
  13.             public void Kiir() { Console.WriteLine(a); }
  14.         }
  15.  
  16.  
  17.         class B : A
  18.         {
  19.             protected int a;
  20.             public B(): this(0, 0) { }
  21.             public B(int x, int y) : base(x) { a = y; }
  22.             public void Kiir() { base.Kiir(); Console.WriteLine(a); }
  23.         }
  24.  
  25.  
  26.         static void Main(string[] args)
  27.         {
  28.             A alfa = new A(12);
  29.             B beta = new B(7, 29);
  30.  
  31.             alfa.Megjelenit();  //12
  32.             beta.Megjelenit();  //7
  33.         }
  34.     }
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top