C# FOR BEGINNERS
LESSON 1
MICHEAL OGUNDERO
CONTACT :
EMAIL – OGUNDEROAYODEJI@GMAIL.COM
Keywords, Identifiers and Naming Conventions
IN THIS LESSON
• KEYWORDS
• IDENTIFIERS
• NAMING CONVENTIONS
KEYWORDS
• Keywords are predefined sets of reserved words that have special
meaning in a program.
• C# has a total of 79 keywords. All these keywords are in lowercase.
• We’ll discuss some other keywords called contextual keywords
in subsequent lessons.
In the next slide is a complete list of all c# keywords!
KEYWORDS
abstract as base bool
break byte case catch
char checked class const
continue decimal default delegate
do double else enum
event explicit extern false
finally fixed float for
foreach goto if implicit
in in (generic modifier) int interface
internal is lock long
namespace new null object
operator out out (generic modifier) override
params private protected public
readonly ref return sbyte
sealed short sizeof stackalloc
static string struct switch
this throw true try
typeof uint ulong unchecked
unsafe ushort using using static
void volatile while
IDENTIFIERS
• Identifiers just as the name implies are used to identify
variables, methods, classes or any other user-defined item.
RULES FOR NAMING IDENTIFIERS
• An identifier cannot be a C# keyword.
• An identifier must begin with a letter, an underscore
or @ symbol. The remaining part of an identifier can contain
letters, digits and underscore symbol.
• Whitespaces are not allowed. Neither can it have symbols other
than letter, digits and underscore.
• Identifiers are case-sensitive.
Therefore, mycat, myCat and MyCat represents 3 different
identifiers.
NAMING CONVENTIONS
• Camel case (camelcase): in this the first letter of word is always
in small letter and after that each word with capital letter.
• Pascal case (pascalcase): in this the first letter of every word is
in capital letter.
• Underscore prefix (_underscore): for underscore (__), the word
after _ use camelcase terminology.
NAMING CONVENTIONS - EXAMPLES
• airConditioner – camelCase
• AirConditioner – Pascal
• _airConditioner - underscore
NEXT LESSON
• DataTypes, variables and constants
• THANK YOU!

c# keywords, identifiers and Naming Conventions

  • 1.
    C# FOR BEGINNERS LESSON1 MICHEAL OGUNDERO CONTACT : EMAIL – OGUNDEROAYODEJI@GMAIL.COM Keywords, Identifiers and Naming Conventions
  • 2.
    IN THIS LESSON •KEYWORDS • IDENTIFIERS • NAMING CONVENTIONS
  • 3.
    KEYWORDS • Keywords arepredefined sets of reserved words that have special meaning in a program. • C# has a total of 79 keywords. All these keywords are in lowercase. • We’ll discuss some other keywords called contextual keywords in subsequent lessons. In the next slide is a complete list of all c# keywords!
  • 4.
    KEYWORDS abstract as basebool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in in (generic modifier) int interface internal is lock long namespace new null object operator out out (generic modifier) override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using using static void volatile while
  • 5.
    IDENTIFIERS • Identifiers justas the name implies are used to identify variables, methods, classes or any other user-defined item.
  • 6.
    RULES FOR NAMINGIDENTIFIERS • An identifier cannot be a C# keyword. • An identifier must begin with a letter, an underscore or @ symbol. The remaining part of an identifier can contain letters, digits and underscore symbol. • Whitespaces are not allowed. Neither can it have symbols other than letter, digits and underscore. • Identifiers are case-sensitive. Therefore, mycat, myCat and MyCat represents 3 different identifiers.
  • 7.
    NAMING CONVENTIONS • Camelcase (camelcase): in this the first letter of word is always in small letter and after that each word with capital letter. • Pascal case (pascalcase): in this the first letter of every word is in capital letter. • Underscore prefix (_underscore): for underscore (__), the word after _ use camelcase terminology.
  • 8.
    NAMING CONVENTIONS -EXAMPLES • airConditioner – camelCase • AirConditioner – Pascal • _airConditioner - underscore
  • 9.
    NEXT LESSON • DataTypes,variables and constants • THANK YOU!