Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Section A.8. CHAPTER 10 SOLUTIONS

A.8. CHAPTER 10 SOLUTIONS

A.8.1. Exercise 1

class MyClass
 {
    protected string myString;

    public string ContainedString
    {
       set
       {
          myString = value;
       }
    }

    public virtual string GetString()
    {
       return myString;
    }
 }

A.8.2. Exercise 2

class MyDerivedClass : MyClass
 {
    public override string GetString()
    {
       return base.GetString() + " (output from derived class)";
    }
 }


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint