Advertisement
PawsonCz

Dziedziczenie

Feb 4th, 2021
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5.  
  6.     public static void Main()
  7.     {
  8.         Iskola uczelnia = new Iskola();
  9.         uczelnia.getNazwa();
  10.         uczelnia.getPrzedmiot();
  11.     }
  12. }
  13.  
  14. class Iskola {
  15.     string nazwa{get; set;}
  16.     public string getNazwa() {
  17.         Console.Write("Which school do you prefer?\t");
  18.         nazwa = Console.ReadLine();
  19.  
  20.         return nazwa;
  21.     }
  22. }
  23.  class Przedmiot : Iskola {
  24.     public void getPrzedmiot() {
  25.         Console.WriteLine("Bazy Danych");
  26.  
  27.        
  28.     }
  29. }
  30.  
  31.  
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement