Using Identifiers on C#

by acul 18. May 2009 10:58

Identifi ers are the names you use to identify the elements in your programs, such as
namespaces, classes, methods, and variables (you will learn about variables shortly). In C#,
you must adhere to the following syntax rules when choosing identifi ers:
  * You can use only letters (uppercase and lowercase), digits, and underscore characters.
  * An identifi er must start with a letter (an underscore is considered a letter).
For example, result, _score, footballTeam, and plan9 are all valid identifi ers, whereas result%,
footballTeam$, and 9plan are not.

Important C# is a case-sensitive language: footballTeam and FootballTeam are not the same
identifi er.

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET

Understanding Statements on C#

by acul 18. May 2009 10:56

A statement is a command that performs an action. You combine statements to create
methods. You’ll learn more about methods in Chapter 3, “Writing Methods and Applying
Scope,” but for now, think of a method as a named sequence of statements. Main, which was
introduced in the previous chapter, is an example of a method. Statements in C# follow a
well-defi ned set of rules describing their format and construction. These rules are collectively
known as syntax. (In contrast, the specifi cation of what statements do is collectively known as
semantics.) One of the simplest and most important C# syntax rules states that you must terminate
all statements with a semicolon. For example, without its terminating semicolon, the
following statement won’t compile: More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET

Defining and Using a Class On C#

by acul 18. May 2009 08:16

In C#, you use the class keyword to define a new class. The data and methods of the class oc-
cur in the body of the class between a pair of braces. Here is a C# class called Circle that con-
tains one method (to calculate the circle’s area) and one piece of data (the circle’s radius): More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET

Stake in the back by chamceul.ind.ws
Hosting by Daxa.Net

Other Links

RecentPosts

RecentComments

Comment RSS