<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FClass%2Finterface</id>
		<title>Csharp/CSharp Tutorial/Class/interface - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FClass%2Finterface"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/interface&amp;action=history"/>
		<updated>2026-04-29T23:49:07Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/interface&amp;diff=5681&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/interface&amp;diff=5681&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/interface&amp;diff=5682&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/interface&amp;diff=5682&amp;oldid=prev"/>
				<updated>2010-05-26T12:16:12Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Abstract Interface: how the abstract BaseClass can interface.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
public interface ICompare {&lt;br /&gt;
    int GetValue();&lt;br /&gt;
    int Compare(ICompare ic);&lt;br /&gt;
}&lt;br /&gt;
abstract public class BaseClass : ICompare {&lt;br /&gt;
    int nValue;&lt;br /&gt;
    public BaseClass(int nInitialValue) {&lt;br /&gt;
        nValue = nInitialValue;&lt;br /&gt;
    }&lt;br /&gt;
    public int Value {&lt;br /&gt;
        get { return GetValue(); }&lt;br /&gt;
    }&lt;br /&gt;
    public int GetValue() {&lt;br /&gt;
        return nValue;&lt;br /&gt;
    }&lt;br /&gt;
    abstract public int Compare(ICompare bc);&lt;br /&gt;
}&lt;br /&gt;
public class SubClass : BaseClass {&lt;br /&gt;
    public SubClass(int nInitialValue)&lt;br /&gt;
        : base(nInitialValue) {&lt;br /&gt;
    }&lt;br /&gt;
    override public int Compare(ICompare ic) {&lt;br /&gt;
        return GetValue().rupareTo(ic.GetValue());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class Class1 {&lt;br /&gt;
    public static void Main(string[] strings) {&lt;br /&gt;
        SubClass sc1 = new SubClass(10);&lt;br /&gt;
        SubClass sc2 = new SubClass(20);&lt;br /&gt;
        MyFunc(sc1, sc2);&lt;br /&gt;
    }&lt;br /&gt;
    public static void MyFunc(ICompare ic1, ICompare ic2) {&lt;br /&gt;
        Console.WriteLine(&amp;quot;bc1.rupare(bc2) returned {0}&amp;quot;,&lt;br /&gt;
                          ic1.rupare(ic2));&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing an interface from a class.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
public interface Channel {&lt;br /&gt;
    void Next();&lt;br /&gt;
    void Previous();&lt;br /&gt;
}&lt;br /&gt;
public interface Book {&lt;br /&gt;
    void Next();&lt;br /&gt;
    void Chapter();&lt;br /&gt;
}&lt;br /&gt;
public class MainClass : Channel, Book {&lt;br /&gt;
    void Channel.Next() {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Channel Next&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    void Book.Next() {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Book Next&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public void Previous() {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Previous&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public void Chapter() {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Chapter&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        MainClass app = new MainClass();&lt;br /&gt;
        ((Book)app).Next();&lt;br /&gt;
        app.Previous();&lt;br /&gt;
        app.Chapter();&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Base class and interface==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;public class Component&lt;br /&gt;
{&lt;br /&gt;
    public Component() {}&lt;br /&gt;
}&lt;br /&gt;
interface Printable&lt;br /&gt;
{&lt;br /&gt;
    void printHeader(float factor);&lt;br /&gt;
    void printFooter(float factor);&lt;br /&gt;
}&lt;br /&gt;
public class TextField: Component, Printable&lt;br /&gt;
{&lt;br /&gt;
    public TextField(string text)&lt;br /&gt;
    {&lt;br /&gt;
        this.text = text;&lt;br /&gt;
    }&lt;br /&gt;
    // implementing Printable.printHeader()&lt;br /&gt;
    public void printHeader(float factor)&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // implementing Printable.printFooter()&lt;br /&gt;
    public void printFooter(float factor)&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    private string text;&lt;br /&gt;
}&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main()&lt;br /&gt;
    {&lt;br /&gt;
        TextField text = new TextField(&amp;quot;Hello&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        Printable scalable = (Printable) text;&lt;br /&gt;
        scalable.printHeader(0.5F);&lt;br /&gt;
        scalable.printFooter(0.5F);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Creating an interface.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
public interface ILog {&lt;br /&gt;
    int OpenLogFile(string fileName);&lt;br /&gt;
    int CloseLogFile();&lt;br /&gt;
    void LogString(string strToLog);&lt;br /&gt;
}&lt;br /&gt;
public class MyLog : ILog {&lt;br /&gt;
    public int OpenLogFile(string fileName) {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Opening File {0}&amp;quot;, fileName);&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
    public int CloseLogFile() {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Closing log file&amp;quot;);&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
    public void LogString(string strToLog) {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Logging String {0}&amp;quot;, strToLog);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
class MainClass {&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        MyLog app = new MyLog();&lt;br /&gt;
        app.OpenLogFile(&amp;quot;AFile&amp;quot;);&lt;br /&gt;
        app.LogString(&amp;quot;Hello world&amp;quot;);&lt;br /&gt;
        app.CloseLogFile();&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Declare an interface and implement it==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;interface IMyIF { &lt;br /&gt;
  int myMeth(int x); &lt;br /&gt;
}&lt;br /&gt;
class MyClass : IMyIF { &lt;br /&gt;
  int IMyIF.myMeth(int x) { &lt;br /&gt;
    return x / 3; &lt;br /&gt;
  } &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Duplicate Interface Members==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
interface Interface1&lt;br /&gt;
{&lt;br /&gt;
   void PrintOut(string s);&lt;br /&gt;
}&lt;br /&gt;
interface Interface2&lt;br /&gt;
{&lt;br /&gt;
   void PrintOut(string t);&lt;br /&gt;
}&lt;br /&gt;
class MyClass : Interface1, Interface2         &lt;br /&gt;
{&lt;br /&gt;
   public void PrintOut(string s)    &lt;br /&gt;
   {&lt;br /&gt;
      Console.WriteLine(&amp;quot;Calling through: {0}&amp;quot;, s);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
   static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      MyClass mc = new MyClass();&lt;br /&gt;
      mc.PrintOut(&amp;quot;object.&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Calling through: object.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implement an interface==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The general form of a class that implements an interface is shown here:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;class class-name : interface-name {&lt;br /&gt;
// class-body&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Inherited interface==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
public interface ISeries { &lt;br /&gt;
  int getNext(); &lt;br /&gt;
  void setStart(int x); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Sequence : ISeries { &lt;br /&gt;
  int val; &lt;br /&gt;
 &lt;br /&gt;
  public Sequence() { &lt;br /&gt;
  }  &lt;br /&gt;
 &lt;br /&gt;
  public int getNext() { &lt;br /&gt;
    return val++; &lt;br /&gt;
  } &lt;br /&gt;
 &lt;br /&gt;
  public void setStart(int x) { &lt;br /&gt;
    val = x; &lt;br /&gt;
  } &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
class MainClass { &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    Sequence ob = new Sequence(); &lt;br /&gt;
 &lt;br /&gt;
    for(int i=0; i &amp;lt; 5; i++) &lt;br /&gt;
      Console.WriteLine(&amp;quot;Next value is &amp;quot; + ob.getNext()); &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;\nStarting at 100&amp;quot;); &lt;br /&gt;
    ob.setStart(100); &lt;br /&gt;
    for(int i=0; i &amp;lt; 5; i++) &lt;br /&gt;
      Console.WriteLine(&amp;quot;Next value is &amp;quot; + ob.getNext()); &lt;br /&gt;
  } &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Next value is 0&lt;br /&gt;
Next value is 1&lt;br /&gt;
Next value is 2&lt;br /&gt;
Next value is 3&lt;br /&gt;
Next value is 4&lt;br /&gt;
Starting at 100&lt;br /&gt;
Next value is 100&lt;br /&gt;
Next value is 101&lt;br /&gt;
Next value is 102&lt;br /&gt;
Next value is 103&lt;br /&gt;
Next value is 104&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interface Explicit Implementation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
&lt;br /&gt;
    interface IStorable&lt;br /&gt;
    {&lt;br /&gt;
        void Read();&lt;br /&gt;
        void Write();&lt;br /&gt;
    }&lt;br /&gt;
    interface ITalk&lt;br /&gt;
    {&lt;br /&gt;
        void Talk();&lt;br /&gt;
        void Read();&lt;br /&gt;
    }&lt;br /&gt;
    public class Document : IStorable, ITalk&lt;br /&gt;
    {&lt;br /&gt;
         public Document(string s)&lt;br /&gt;
        {&lt;br /&gt;
            Console.WriteLine(&amp;quot;Creating document with: {0}&amp;quot;, s);&lt;br /&gt;
        }&lt;br /&gt;
        public virtual void Read()&lt;br /&gt;
        {&lt;br /&gt;
            Console.WriteLine(&amp;quot;Implementing IStorable.Read&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        public void Write()&lt;br /&gt;
        {&lt;br /&gt;
            Console.WriteLine(&amp;quot;Implementing IStorable.Write&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        void ITalk.Read()&lt;br /&gt;
        {&lt;br /&gt;
            Console.WriteLine(&amp;quot;Implementing ITalk.Read&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        public void Talk()&lt;br /&gt;
        {&lt;br /&gt;
            Console.WriteLine(&amp;quot;Implementing ITalk.Talk&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public class Tester&lt;br /&gt;
    {&lt;br /&gt;
        static void Main()&lt;br /&gt;
        {&lt;br /&gt;
            Document theDoc = new Document(&amp;quot;Test Document&amp;quot;);&lt;br /&gt;
            IStorable isDoc = theDoc;&lt;br /&gt;
            isDoc.Read();&lt;br /&gt;
            ITalk itDoc = theDoc;&lt;br /&gt;
            itDoc.Read();&lt;br /&gt;
            theDoc.Read();&lt;br /&gt;
            theDoc.Talk();&lt;br /&gt;
        }&lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interface Properties==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here is the general form of a property specification:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;// interface property&lt;br /&gt;
type name {&lt;br /&gt;
    get;&lt;br /&gt;
    set;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interfaces==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;An interface provides no implementation.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Interfaces are declared by using the interface keyword.&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Here is a simplified form of an interface declaration:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;interface name {&lt;br /&gt;
        ret-type method-name1(param-list);&lt;br /&gt;
        ret-type method-name2(param-list);&lt;br /&gt;
        // ...&lt;br /&gt;
        ret-type method-nameN(param-list);&lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interfaces and Inheritance==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
interface MyInterface&lt;br /&gt;
{&lt;br /&gt;
    void MyMethodInInterface();&lt;br /&gt;
}&lt;br /&gt;
public class Base: MyInterface&lt;br /&gt;
{&lt;br /&gt;
    public void MyMethodInInterface()&lt;br /&gt;
    {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Base.MyMethodInInterface()&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class Derived: Base&lt;br /&gt;
{&lt;br /&gt;
    public new void MyMethodInInterface()&lt;br /&gt;
    {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Derived.MyMethodInInterface()&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main()&lt;br /&gt;
    {&lt;br /&gt;
        Derived der = new Derived();&lt;br /&gt;
        der.MyMethodInInterface();&lt;br /&gt;
        MyInterface helper = (MyInterface) der;&lt;br /&gt;
        helper.MyMethodInInterface();&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Derived.MyMethodInInterface()&lt;br /&gt;
Base.MyMethodInInterface()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Multiple Implementation: implement two interfaces==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;interface IFoo&lt;br /&gt;
{&lt;br /&gt;
    void ExecuteFoo();&lt;br /&gt;
}&lt;br /&gt;
interface IBar&lt;br /&gt;
{&lt;br /&gt;
    void ExecuteBar();&lt;br /&gt;
}&lt;br /&gt;
class Tester: IFoo, IBar&lt;br /&gt;
{&lt;br /&gt;
    public void ExecuteFoo() {}&lt;br /&gt;
    public void ExecuteBar() {}&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Multiple Interfaces==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
    interface IVolumeControl&lt;br /&gt;
    {&lt;br /&gt;
        int Current&lt;br /&gt;
        {&lt;br /&gt;
            get;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
    interface ISpeedControl&lt;br /&gt;
    {&lt;br /&gt;
        int Current&lt;br /&gt;
        {&lt;br /&gt;
            get;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public class Radio : IVolumeControl, ISpeedControl&lt;br /&gt;
    {&lt;br /&gt;
        int IVolumeControl.Current&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        int ISpeedControl.Current&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
                return 2;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    class Class1&lt;br /&gt;
    { &lt;br /&gt;
        [STAThread]&lt;br /&gt;
        static void Main(string[] args)&lt;br /&gt;
        {&lt;br /&gt;
           ISpeedControl radioDial = (ISpeedControl) new Radio();&lt;br /&gt;
           Console.WriteLine( &amp;quot;Current Speed = {0}&amp;quot;, radioDial.Current );&lt;br /&gt;
        }&lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use interface keyword to define an interface==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
interface Interface1&lt;br /&gt;
{&lt;br /&gt;
   void PrintOut(string s);&lt;br /&gt;
}&lt;br /&gt;
class MyClass : Interface1&lt;br /&gt;
{&lt;br /&gt;
   public void PrintOut(string s)&lt;br /&gt;
   {&lt;br /&gt;
      Console.WriteLine(&amp;quot;Calling through: {0}&amp;quot;, s);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
   static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      MyClass mc = new MyClass();&lt;br /&gt;
      mc.PrintOut(&amp;quot;object.&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Calling through: object.&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>