Example #1
0
    public static void Main()
    {
        TestClass1 tc1 = new TestClass1();
        TestClass2 tc2 = new TestClass2();

        // The following call fails because TestClass1 does not have
        // a method called DisplaySomething.
        tc1.DisplaySomething("Hello");              // CS1061

        // To correct the error, change the method call to either
        // tc1.WriteSomething or tc2.DisplaySomething.
        tc1.WriteSomething("Hello from TestClass1");
        tc2.DisplaySomething("Hello from TestClass2");
    }