Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Lab01
- {
- abstract class Osoba
- {
- string Name;
- public Osoba()
- {
- Console.WriteLine("Utworzono objekt klasy 'Osoba'");
- Name = "unknown";
- }
- public Osoba(string name)
- {
- Console.WriteLine("Utworzono objekt klasy 'Osoba' i zainicjowano pole 'Name'");
- Name = name;
- }
- public void Je(string jedzenie)
- {
- }
- public void Ubiera(string ubranie)
- {
- }
- }
- class Ojciec : Osoba
- {
- }
- class Syn : Osoba
- {
- }
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Hello");
- var person1 = new Ojciec();
- var person2 = new Syn("Jakub");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement