Skip to main content

What is Class and Object in C#

A class is like a blueprint of specific object. In the real world, every object has some kinds of data and functionalities. For example, the iPhone . iPhone is an object of the Smartphone type. The Smartphone is a class that specify certain characteristic like  Display size,Color ,Weight, Thickness etc. So any company that makes a Smartphone that meet those requirements is an object of the Smartphone type. For example, every single Smartphone of Apple, Samsung, BlackBerry are an object of the class called 'Smartphone'. Here, 'Smartphone' is a class and every single physical Smartphone is an object of the Smartphone class.

Likewise, in object oriented programming, a class defines certain properties, fields, events, method etc. A class defines the kinds of data and the functionality their objects will have.

A class enables you to create your own custom types by grouping together variables of other types, methods and events.

In C#, a class can be defined by using the class keyword.



public class Smartphone
{

  public double length;   
        public double breadth;  
        public double height; 

public Smartphone()
{

}

}

Comments

Popular posts from this blog

What is SQL?

SQL stands for Structured Query Language. SQL is used to communicate with a database. According to American National Standards Institute (ANSI), it is the standard language for relational database management systems. SQL statements are used to define and manipulate data on a database.  Some common relational database management systems that use SQL are: Oracle, Microsoft SQL Server, Access, etc.

How to Create Database in SQL Server

This article demonstrates how to Create Database in SQL server This steps is based on  SQL Server 2017 Express Edition (2008 edition is almost same )  Open Microsoft SQL Server Management Studio   Connect to Server (Login with id and password)    Right click over Databases Folder in Object Explorer Window     Select New Database... Then Open a New Database Window Then Enter a Name For  Database Then click OK then we can see our new data base under Databases folder in Object Explorer. See Our YouTube Video And Subscribe Our Channel For More Details 

What is C# ?

C# is pronounced as "C-Sharp". It is an object-oriented programming language provided by Microsoft that runs on .Net Framework. We can develop different types of Window and Web applications by the help of C# programming language. C# is designed for CLI (Common Language Infrastructure). CLI is a specification that describes executable code and runtime environment. C# is approved as a standard by ECMA and ISO.