Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Vaja05
- {
- class Program
- {
- static void Main(string[] args)
- {
- dalmatinec lux = new dalmatinec();
- lux.Nastavi("lux", 14, 101);
- lux.Izpisi();
- }
- }
- class pes
- {
- protected string ime;
- protected int teza;
- public virtual void Izpisi()
- {
- Console.WriteLine(this.ime + " " + this.teza);
- }
- public void Nastavi(string ime, int teza)
- {
- this.ime = ime;
- this.teza = teza;
- }
- }
- class dalmatinec : pes
- {
- private int stPik;
- public void Nastavi(string ime, int teza, int stPik)
- {
- this.ime = ime;
- this.teza = teza;
- this.stPik = stPik;
- }
- public override void Izpisi()
- {
- Console.WriteLine(this.ime+" "+ this.teza + " "+ this.stPik);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement