Your browser does not support JavaScript! Please enable script of your browser.
 
Coding is Rhyme
Handy Tricks For Beginners & Professionals
C# 5.0, 4.0 - Tutorial, Article, Archive, Pdf, Handy Tricks, Code Snippets, Training, Reference Manual, .Net Framework, CLR, CTS, MSIL, IL, Class, Structure, Constructor, Property, Indexer, Inheritance, Interface, Delegates, Attributes

Introduction to C Sharp

Posted By : Shailendra Chauhan, 22 Aug 2011
Updated On : 14 Jul 2012
Keywords : C #, Class in C# pdf, C# Introduction, History of C Sharp

C# is developed by microsoft and comes after C, C++, Java. It inherits the properties of C, C++, Java, VB. We can say C# is smart and intelligent sister of Java because it do work smartly in comprasion to Java. The basic concept of C# language are same as C, C++ to whom you have learnt in C, C++ tutorials. The advance concept of C# language are as :

Object

Object is representative of the class and is responsible for memory allocation of its data members and member functions.An object is a real world entity having attributes (data type) and behaviors (functions).

Class

Class is a data structure that contains data members (constants files, events), member function methods, properties, constructor, destructor, indexers and nested type.Basically :

  1. It is a user defined data type.

  2. It is a reference type.

  3. Infact class is a tag or template for object.

Drawback of Class

Class does not allocate memory to its data members & member function itself.Basically memory is allocated through object of a class.Class can’t explore itself means it can not access its members itself, to access members of a class we use object of that class.

Example :

 // Namespace Declaration
using System; 
// helper class 
class ClassA 
{ 
string myString; 
// Constructor
public ClassA(string str) 
{ 
myString = str;
 } 
 // Instance Method 
 public void Show() 
 { 
 Console.WriteLine("{0}", myString);
 } 
 // Destructor 
 ~ClassA()
 { 
 // Some resource cleanup routines
 } 
} 
// Program start class 
class ClassProgram 
{ 
// Main begins program execution
public static void Main() 
{ 
// Instance of ClassA 
ClassA objA = new ClassA("Welcome to the world of C# language !!");
// Call ClassA method 
 objA.Show();
 } 
} 
About the Author
Shailendra Chauhan works as Sr. Software Engineer at reputed MNC and has more than 5 years of hand over Microsoft .NET technologies. He is a .NET Consultant and is the founder & chief editor of www.dotnet-tricks.com and www.dotnetinterviewtricks.com blogs. He is an author of books ASP.NET MVC Interview Questions and Answers & LINQ Interview Questions and Answers.
He loves to work with web applications and mobile apps using Microsoft technology including ASP.NET, MVC, C#, SQL Server, WCF, Web API, Entity Framework,Cloud Computing, Windows Azure, jQuery, jQuery Mobile, Knockout.js, Angular.js and many more web technologies. More...
 
 
Recommended Articles!
 
 
Search Articles
 
 
Subscribe & follow Us
 
 
Protected by Copyscape Web Plagiarism Check
 
Free ASP.NET MVC Interview Book
Learn In Hindi
Browse By Category
 
Recent Articles
 
Popular Articles
 
Like us on Facebook
 
Featured AD
Join our Training programs in Delhi/Noida on ASP.NET MVC, WCF, EF, jQuery - call us    +91-9871749695