Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 4.0 aka C# 2010 > BOOK: Beginning Visual C# 2010
|
BOOK: Beginning Visual C# 2010
This is the forum to discuss the Wrox book Beginning Visual C# 2010 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, ; ISBN: 9780470502266
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2010 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 27th, 2012, 08:52 PM
Registered User
 
Join Date: Dec 2009
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Question To the author of Beginning Visual C# 2010

Please change the example of Ch10Ex01.

...How It Works
The code in Main() creates and uses an instance of the MyClass class defined in MyClass.cs. Instantiating this class must be performed using a nondefault constructor because the default constructor of MyClass is private:
private MyClass() : this("Default Name")
{
}

Using this("Default Name") ensures that Name gets a value if this constructor is ever called, which is possible if this class is used to derive a new class. This is necessary because not assigning a value to the Name field could be a source of errors later. ....

As a beginner, the red-color-marked sentences confused me a long time, it is impossible to call a base-private-constructor from its derived-class. So please change the description in next edition. Or if I am wrong, can you explain this to me and give me an example?
The Following User Says Thank You to sbwfnyiiiu For This Useful Post:
arun_babu_a (August 20th, 2012)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning Visual Basic 2010 and Microsoft Access QIBusinessGroup BOOK: Beginning Microsoft Visual Basic 2010 4 August 3rd, 2011 09:14 PM
Where to obtain software for Ivor Horton's Book--Beginning Visual C++ 2010 kennygc BOOK: Ivor Horton's Beginning Visual C++ 2010 4 January 19th, 2011 02:05 PM
Visual Studio 2010 in Focus at Great Indian Developer Summit 2010 shaguf5575 ASP.NET 1.x and 2.0 Application Design 0 February 24th, 2010 07:03 AM
Visual Studio 2010 in Focus at Great Indian Developer Summit 2010 shaguf5575 ASP.NET 1.x and 2.0 Application Design 0 February 24th, 2010 07:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.