MORE INFORMATION
CD-ROM: Incorrect variable name used in \Chapter 2\prop_error\person1.cs and \Chapter 2\prop_error\person2.cs sample files
The ninth line of both the \Chapter 2\prop_error\person1.cs and \Chapter 2\prop_error\person2.cs sample files reads:
if(age<0 || age>120) {
It should read:
if(value<0 || value>120) {
CD-ROM: Updated code samples for Refactoring Walkthrough in chapter 4 available for download
Updated code samples are available for the Refactoring Walkthrough in chapter 4. The following file is available for download from the Microsoft Download Center:
Airline.exeFor additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
Page 11: Missing ")" and ";" in code sample
On Page 11, the 12th line of the first code sample reads:
Console.WriteLine(objGreeting.French
It should read:
Console.WriteLine(objGreeting.French);
Page 15: Error should be Pragma
On page 15, midway down the page, it reads:
"The #pragma directive enables or disables standard compilation
warnings.
Error directives:
#error warning disable warning_list
#error warning restore warning_list
"
It should read:
"Pragma directives:
#pragma warning disable warning_list
#pragma warning restore warning_list
"
Page 21: Incorrect Sample code for Postfix Increment and Postfix Decrement in Table 1-4
On page 21, the Postfix Increment and Postfix Decrement rows of Table 1-4 read:
Postfix Increment ++ variable --; 10; 10
Postfix Decrement -- variable ++; 11
They should read:
Postfix Increment ++ variable ++; 11
Postfix Decrement -- variable --; 10
Page 24: Error in Conditional Operator example
On page 24, under Ternary operators, the Conditional Operator example currently reads:
boolean_expression:truth_statement?false_statement
It should read:
boolean_expression?truth_statement:false_statement
Page 37: Variable name error in code sample
On page 37, the second code sample in the "Nullable Types" section reads:
double? variablea=null;
It should read:
double? variable1=null;
Page 37: variablea referenced in place of variable2
On page 37, the second to last sentence of the final paragraph reads:
"This code sets the default value for variablea to zero."
It should read:
"This code sets the default value for variable2 to zero."
Page 40: Error in switch statement explanation
On page 40, below the sample Switch statement code, the sixth sentence in the paragraph reads:
"If switch label matches the switch expresssion..."
It should read:
"If no switch label matches the switch expression..."
Page 48: Incorrect variable name used in code sample
On page 48, the ninth and tenth lines of the code sample read:
Employee Jim=new Employee();
Fred.name="Wilson, Jim";
They should read:
Employee Fred=new Employee();
Fred.name="Wilson, Fred";
Page 66: Error in description of constructor output
On page 66, the fourth sentence of the paragraph immediately following the bulletted list reads:
"The static constructor is stubbed to output a method."
It should read:
"The static constructor is stubbed to output a message."
Page 68: Destructor description missing the word "name"
On page 68, the fifth sentence of the Destructors section reads:
"Like a constructor, the destructor has the same as the class..."
It should read:
"Like a constructor, the destructor has the same name as the class...
"
Page 71: Term "backing" used in place of the term "data"
On page 71, the first line currently reads:
"public, whereas the backing store is private."
This should read:
"public, whereas the data store is private.
"
Page 80: Technical error in comparison of locala and localb variables
On page 80, the fourth and fifth sentences of the second paragraph in the "Identity versus Equivalence" section read:
"The variables locala and localb are not equivalent. They have the same values but are stored at different locations on the stack:"
They should read:
"The variables locala and localb are neither equivalent nor identical. They have different values and are stored at different locations on the stack:"
Page 80: Example variable has the wrong type
On page 80, the third line of the first code sample in the "Identity versus Equivalence" section reads:
double localc=5;
It should read:
int localc=5;
Page 150: Derived class referenced in place of base class
On page 150, the last sentence of the first paragraph reads:
"This both creates the inheritance relationship and adds the derived class to the class diagram."
It should read:
"This both creates the inheritance relationship and adds the base class to the class diagram."
Page 150: Incorrect instruction for creating a derived class relationship
On page 150, the third sentence on the page reads:
"Drag the inheritance line from the base class to the derived class."
It should read:
"Drag the inheritance line from the derived class to the base class."
Page 187: Term "multirectangle" used in place of "multidimensional"
On page 187, the fourth sentence of the first paragraph reads:
"Multirectangle arrays are rectangular and consist of rows and columns."
It should read:
"Multidimensional arrays are rectangular and consist of rows and columns."
Pages 235-236: Technical errors in code sample
On pages 235-236, the code sample reads:
using System;
namespace Donis.CSharpBook{
public class Starter{
public static void Main(){
StackInt stack=new StackInt(5);
stack.Push(10);
stack.Push(15);
Console.WriteLine("Pushed 3 values");
stack.ListItems();
stack.Pop();
Console.WriteLine("Popped 1 value");
stack.ListItems();
}
}
public class StackInt {
public StackInt(int firstItem) {
list=new int[1] {firstItem};
}
public int Pop() {
if(top!=0) {
return list[--top];
}
throw new Exception("Stack empty");
}
public void Push(int topitem) {
++top;
if(top==list.Length) {
int [] temp=new int[top+1];
Array.Copy(list, temp, top);
list=temp ;
}
list[top]=topitem;
}
public void ListItems () {
for(int item=0;item<=top;++item) {
Console.WriteLine(list[item]);
}
}
private int [] list;
private int top=0;
}
}
It should read:
using System;
namespace Donis.CSharpBook{
public class Starter{
public static void Main(){
StackInt stack=new StackInt(5);
stack.Push(10);
stack.Push(15);
Console.WriteLine("Pushed 3 values");
stack.ListItems();
stack.Pop();
Console.WriteLine("Popped 1 value");
stack.ListItems();
}
}
public class StackInt {
public StackInt(int firstItem) {
list=new int[1] {firstItem};
top++;
}
public int Pop() {
if(top!=(-1)) {
return list[top--]; //was list[--top]
}
throw new Exception("Stack empty");
}
public void Push(int topitem) {
++top;
if(top==list.Length) {
int [] temp=new int[top+1];
Array.Copy(list, temp, top);
list=temp ;
}
list[top]=topitem;
}
public void ListItems () {
for(int item=0;item<=top;++item) {
Console.WriteLine(list[item]);
}
}
private int [] list;
private int top=(-1);
}
}
Page 281: The term "an enumerator" is used in place of "enumerated"
On page 281, the fourth sentence of the first paragraph reads:
"In Main, the collection is an enumerator in a generic and nongeneric manner."
It should read:
"In Main, the collection is enumerated in a generic and nongeneric manner."
Page 281: Incorrect variable name used in the code sample
On page 281, the 14th line of the code sample reads:
foreach(int number in generic) {
It should read:
foreach(int number in simple) {
Microsoft Press is committed to providing informative and accurate
books. All comments and corrections listed above are ready for
inclusion in future printings of this book. If you have a later printing
of this book, it may already contain most or all of the above corrections.
The print number of the book is located on the copyright page in the form of a string of numbers. For example: "2 3 4 5 6 7 8 0 QWT 9 8 76 5 4". The first number in the string is the the print number. In this example, the print number is 2.