Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public partial class A
- {
- protected string text;
- public A ( string text)
- {
- this.text = text;
- }
- public void DoWork()
- {
- Console.WriteLine ("Do Work!");
- }
- public void DoSomething()
- {
- Console.WriteLine ("Do Work {0}", text);
- }
- }
- public partial class A
- {
- public void DoWork2()
- {
- Console.WriteLine ("Do Work 2!");
- }
- }
- public partial class B : A
- {
- //mora da postoji ovakav konstruktor kao klasi A
- public B(string text) : base(text)
- {
- }
- public void DoWork3()
- {
- Console.WriteLine ("Do Work {0} ", text);
- }
- }
- public partial class B : A
- {
- public void DoWork4()
- {
- Console.WriteLine ("Do Work {0} ", text);
- }
- }
- class MainClass {
- public static void Main (string[] args) {
- B b = new B("KOLE");
- b.DoWork3();
- b.DoWork();
- b.DoWork2();
- b.DoWork4();
- b.DoSomething();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement