Lecture 3 - Introduction To C# and
Lecture 3 - Introduction To C# and
PROGRAMMING
LECTURE 3 – INTRODUCTION TO C# AND .NET
TOPICS
C#
VISUAL PROGRAMMING
We can build web based app with C# and Microsoft’s ASP.NET
technology
MICROSOFT’S .NET
INTRODUCTION
Comments
o Are ignored by the compilers
o Used to clarify about the codes
Types of comments
o //: single-line comment
o /* ….*/: delimited comments
USING DIRECTIVE
A using directive tells compiler to look for a class that’s used in this app
C# provides thousand of classes to reuse
o These classes are organized into namespaces
o E.g., using System;
CLASS DECLARATION
Every app consists of at least one class declaration that defined by the programmer
o user-defined class
o E.g., public class Welcome1
Class Name convention (upper camel casing)
o Begin with a capital letter
o Capitalize the first letter of each word included
o Contains letters, digits, and underscore
o Doesn’t start with digit, doesn’t contain spaces
C# is case sensitive
o So be careful because Myname is different from MyName
C# METHOD AND STATEMENTS
Main method
o public static void Main(string[] args)
o It’s the starting point of every app
Statements
o Statements end with a semicolon (;)
MULTIPLE LINE STATEMENT
FORMATTING TEXT
DECLARE A VARIABLE