public void TemplateMethod(IPrimitives primitives) { var result = primitives.Operation1() + primitives.Operation2(); Console.WriteLine(result); }
public void TemplateMethod(IPrimitives a) { var s = a.Operation1() + a.Operation2(); Console.WriteLine(s); }
public void TemplateMethod(IPrimitives a) { string s = a.Operation1() + a.Operation2(); Console.WriteLine(s); }
//prima objekt tipa sucelja public void TemplateMethod(IPrimitives a) { //mora znati pozvati metode Operation1() i Operation2() nad objektom tipa sucelja(a), ali ne mora znati za koju tocno klasu!!!! string s = a.Operation1() + " " + a.Operation2(); Console.WriteLine(s); }