Advertisement
Guest User

Untitled

a guest
Apr 5th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Lab01
  8. {
  9.     abstract class Osoba
  10.     {
  11.         string Name;
  12.         public Osoba()
  13.         {
  14.             Console.WriteLine("Utworzono objekt klasy 'Osoba'");
  15.             Name = "unknown";
  16.         }
  17.         public Osoba(string name)
  18.         {
  19.             Console.WriteLine("Utworzono objekt klasy 'Osoba' i zainicjowano pole 'Name'");
  20.             Name = name;
  21.         }
  22.         public void Je(string jedzenie)
  23.         {
  24.  
  25.         }
  26.         public void Ubiera(string ubranie)
  27.         {
  28.  
  29.         }
  30.  
  31.     }
  32.      class Ojciec : Osoba
  33.     {
  34.        
  35.     }
  36.      class Syn : Osoba
  37.     {
  38.  
  39.     }
  40.  
  41.  
  42.     class Program
  43.     {
  44.         static void Main(string[] args)
  45.         {
  46.             Console.WriteLine("Hello");
  47.             var person1 = new Ojciec();
  48.             var person2 = new Syn("Jakub");
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement