Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace test_0
- {
- internal class Program
- {
- private static void Main(string[] args)
- {
- Pies burek = new Pies("bury", 13, "kundel");
- Pies azor = new Pies("biały", 50, "maltanczyk");
- Console.WriteLine(burek.kolorSiersci);
- Console.WriteLine(azor.waga);
- Console.WriteLine(azor.Szczekaj());
- Console.ReadKey();
- }
- }
- public class Pies //deklaruje klase Pies
- {
- //pola klasy
- public string kolorSiersci;
- public ushort waga;
- public string rasa;
- public string Szczekaj()
- {
- return "hauhau";
- }
- //metody klasy
- public Pies(string kolorSiersci, ushort waga, string rasa)
- {
- this.kolorSiersci = kolorSiersci;
- this.waga = waga;
- this.rasa = rasa;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment