top of page

FOLLOW ME:

C Sharp Free Tutorial

  • tekslate
  • Jan 6, 2015
  • 2 min read

C# syntax is highly expressive, yet it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin to work productively in C# within a very short time. C# syntax simplifies many of the complexities of C++ and provides powerful features such as nullable value types, enumerations, delegates, lambda expressions and direct memory access, which are not found in Java. C# supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code. Language-Integrated Query (LINQ) expressions make the strongly-typed query a first-class language construct.

As an object-oriented language, C# supports the concepts of encapsulation, inheritance, and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition. In C#, a struct is like a lightweight class; it is a stack-allocated type that can implement interfaces but does not support inheritance.

Loops

Syntax of for loop

For (initialization ; condition , ++ (or) --)

{

Statements;

}

While Syntax

While (condition)

{

Statements ;

}

Do While Syntax

Do

{

Statements ;

} While (condition)

Enumerators (enum) enum is a keyword

enum is a collection of integral Constants , which will be Identified with string constants.

enum is a user defined data type.

Syntax to write enum

Enum enum _name

{

String value = Integer value,

String value = Integer value,

String value = Integer value,

}

enum must be declared in general declaration (Go) area only.

To Learn More Follow Below Link:

 
 
 

Commentaires


  • Facebook Clean Grey
  • Twitter Clean Grey
  • Instagram Clean Grey

RECENT POSTS: 

SEARCH BY TAGS: 

© 2023 by Closet Confidential. Proudly created with Wix.com

  • b-facebook
  • Twitter Round
  • Instagram Black Round
bottom of page