Head First C# Logo

Converting Head First Java Concepts and Code to C#

Chapter 3

Page 53:  Reserved Keywords

C# Here is a list of C# Keywords (reserved identifiers) keywords.


Page 59:  Arrays

Java: int[] nums;
C#: int[] nums;
Note: In the above example  the C# vs. Java syntax is the same, but from MSDN note the following interesting point : "In C#, the square brackets in the array declaration must follow the data type [as they are above] , and cannot be placed after the variable name as is permitted in Java." 

View an example of this syntax in these  Java array declaration samples (from www.janeg.ca).

Thus, the syntax int nums[ ] is not permitted in C# but is permitted in Java.

Page 62:  Dog Example Code

Java: Dog.java - the first line will print null when there is no data defined
C#: Dog.cs - the first line will print a blank space when there is no data defined.
Note: Download the Dog.cs file to see the example.