




































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





































































Basics of the C# language for the VB programmer Language syntax The basics of data types Numeric types Integral types Floating point types String types
All words are categorized as Identifiers (programmer chosen names) Keywords (words reserved by the C# language) You can force a keyword to operate as a variable using the @ character Literals (numbers or strings you embed into the application)
In C#, all statements end with a semicolon ; Statements can span multiple lines There is no need for a continuation character as in VB Example C# System.Console.WriteLine( “This is a line of text”); Example VB System.Console.WriteLine( _ “This is a line of text”);
In VB, blocks are marked with keywords Sub – End Sub If – End If Do Loop While End While In C#, blocks are all marked with {} as in Java or C++
XMLSummary comments begin with /// Single line comments are marked with // Multi-line comments start with /* and end with */
// A comment.
/ This is Also a comment /
That blueprint defines the range of allowable values and other information Types are predefined by the C# language Custom types you create work the same way
We call this type symmetry
Complex types are created from primitive types and other complex types These types contain Data members Function members A special function member called a constructor
All types fall into one of the following two categories Value types comprise most built-in types enum and struct are also value types Arrays and classes are reference types Along with just about everything else
There are two parts to a reference type An object A reference to the object See figure 2-3 on page 18
A special case when a reference type variable DOES NOT point to an object Here is where null reference exceptions come from
Variable declarations work the same way in both C# and VB Local variables are declared inside of a procedure Module-level variables are declared outside of a procedure In C#, the declaration syntax is reversed from VB
Dim count As Integer Dim MyName As String = “Ekedahl”
int count; string MyName = “Ekedahl”;