Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Basic of C# (Chapter-1)

C# (C-Sharp)is an Object-oriented Programming Language developed by Microsoft that intends to be a simple, modern, and general-purpose programming language for application development.




Ø Topics which going to covered

v  Explain features of the object-oriented methodology
v  Describe the phases of the object-oriented methodology
v  Define classes in C#
v  Declare variables
v  Write and execute C# programs

Object-Oriented Methodology

Ø  Object orientation is a software development methodology that is based on modeling a real-world system.
Ø  An object oriented program consists of classes and objects.
Ø  Object is the instance of class. It is state, behavior, unique identity. It interact with other objects through messages.

Characteristics of the Object-Oriented Approach
Ø  Realistic modeling
Ø  Reusability
Ø  Resilience to change
Ø  Existence as different forms

Phases of Object Orientation
Ø  The following phases are involved in the software development:
v  The Analysis phase
v  The Design phase
v  The Implementation phase

Introducing C#
Ø  A program is a set of instructions to perform a specific task.
Ø  Programming languages use programs to develop software applications.
Ø  A compiler is a special program that processes the statements written in a particular programming language and converts them into a machine language.
Ø  This process of conversion is called compilation.
Ø  C#, also known as C-Sharp, is a programming language introduced by Microsoft.
Ø  C# is specially designed to work with the Microsoft’s .NET platform.



Eg
Public Class student
  {
    Public static void main(String[] args)
      {
         Console.WriteLine(“Welcome to C# World”);
     }
}
Note: Main() Function Is the entry point of an application .It Is used to create objects and invoke member function.

Declaring Variables

Ø  A variable is a location in the memory that has a name and contains a value.
Ø  A variable is associated with a data type that defines the type of data that can be stored in a variable.
Syntax
=;
              Eg:-  int age=10;

Naming variables in C#

Ø  The following rules are  used for naming variables in C#:
v  Must begin with a letter or an underscore
v  Should not contain any embedded spaces or symbols
v  Must be unique
v  Can have any number of characters

Ø  Keywords cannot be used as variable names

Declaration of Variable are of two types:

1)Value Type Variable: are those variable which stores the value in stack. Eg int,char,decimal,bool,float.

2)Reference Type Variable : are those variables which take the references of memory .Eg string and Object.

Simple Program in C# to Display Hello World!!

  Class Student
{
    Public void display()
            {
                 Consolw.WriteLine(“Hello World !!”);
             }
}
Class Demo
{
    Public static void main(String[] args)
           {
            Student objstd=new Student();
            Objstd.display();
           }
}

Kindly click on Follow me   for more updates

Kindly share this link to your friends on Facebook,Whats up,Twitter,Google+ .If you do this you will safe Yourself .

http://www.technotechmedia.com/2016/07/basic-of-c-chapter-1.html



This post first appeared on Pivot In SQL Server, please read the originial post: here

Share the post

Basic of C# (Chapter-1)

×

Subscribe to Pivot In Sql Server

Get updates delivered right to your inbox!

Thank you for your subscription

×