Errata

Learning C#

Errata for Learning C#

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 42
Example 5-5. Using an enumeration

enum Temperatures
{
WickedCold = 0,
FreezingPoint = 32,
LightJacketWeather = 60,
SwimmingWeather = 72,
BoilingPoint = 212,
}

should read ---

enum Temperatures
{
WickedCold = 0,
FreezingPoint = 32,
LightJacketWeather = 60,
SwimmingWeather = 72,
BoilingPoint = 212
}

There should not be comma after the last item in the list, 212.

Anonymous  Jun 25, 2008 
Printed Page 86
example 5-9

Party.Democrat is hard wired, yet output still states that a valid choice was not
made.

Anonymous   
Printed Page 107
Example 8-7, Static Fields

Example 8-7, Static Fields, lines 15 and 19. The VS editor doesn't recongnize the
word "String" as the C# string keyword because of the capital "S". Lines 15 and 19
should be changed to read "private string name;" and "public Cat(string name, int
weight)".

This problem doesn't seem to affect program compilation and execution; however,
prevent the VS editor from displaying the string keywords in a blue font color.
Keywords in a default editor configuration are shown in blue.

Anonymous   
Printed Page 150
"public int Hour" Property

set should be indented to be inline with get

Anonymous   
Printed Page 155
Example 8-4 code Passing by reference

In the example code around line 25 he has posted

public void GetTime(int theHour, int theMinute, int theSecond)
{
theHour = Hour;
theMinute = Minute;
theSecond = Second;
}

It should have

public void GetTime(ref int theHour, ref int theMinute, ref int theSecond)
{
theHour = Hour;
theMinute = Minute;
theSecond = Second;
}

or the example code doesnt compile in visual C# express

Anonymous   
Printed Page 200
The second code fragment under Controlling Access

The copyright page of my book shows:

Printing History:
September 2002: First Edition
February 2006: Second Edition

And the bottom right hand corner says: [6/06]
-- -- --
This section is mentioned under "Changes made in the 6/06 reprint" section of your
web site. This is what is shown on your page:

[start excerpt]

Anonymous   
Printed Page 200
under Controlling Access

MyOtherClass inherits myValue from MyClass thus the definition of MyOtherClass

public class MyOtherClass : MyClass
{
Console.WriteLine("myInt: {0}", myInt);
}

NOW READS:

public class MyOtherClass : MyClass
{
Console.WriteLine("myInt: {0}", myValue);
}

Furthermore, all subsequent appearances of myInt in the Controlling Access section
HAVE BEEN CHANGED to myValue
[end excerpt]

My book has the myValue changes but the class declaration reads:

public class MyClass : MyOtherClass
{
Console.WriteLine("myInt: {0}", myValue);
}

The order of MyClass and MyOtherClass should be reversed since MyOtherClass derives
from MyClass.

Anonymous   
Printed Page 269, 270 and 271
Example 17-3, Example 17-4 and Example 17-5

In Examples 17-3, 17-4 and 17-5, the statement 'string s1 = "abcd"' is not used and
gives a compiler error.

Anonymous   
Printed Page 282
Output for example 14-4

The last line of the output appears to be a typo.

Output for 14-4:

0 5 10 15 20
100 101 102 103 104
empArray.Capacity: 8 <-------

Is this supposed to be empList.Capacity: 5?

Anonymous   
Printed Page 413
3rd paragraph

...causes the page to be sent to the browser...
should probably be:
...causes the page to be sent to the server...

Anonymous   
Printed Page 440
Solution to Exercise 3-2

myFloat is declared twice in the program.

float myFloat = 4.25f;
...
...
float myFloat = 25.267f;

Anonymous   
Printed Page 475
Last line of the Solution to Question 13-7

The last line should be:
as "ILoggedCompressible extends ICompressible."
instead of being:
as "ILoggb[edCompressible extends ICompressible."

Anonymous