When you define a class, you define a blueprint for a data type. This does not actually define any data, but it does define what the class name means. That is, what an object of the class consists of and what operations can be performed on that object. Objects are instances of a class. The methods and variables that constitute a class are called members of the class.
using System; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Employee { String EName, EColor, EQualification, EDesignation; int EAge; public void Get() { Console.WriteLine("Enter the Employee's Name,Color,Qualification,Designation and Age "); this.EName = Console.ReadLine(); this.EColor = Console.ReadLine(); this.EQualification = Console.ReadLine(); this.EDesignation = Console.ReadLine(); this.EAge = Convert.ToInt32(Console.ReadLine()); } public void Display() { Console.WriteLine("Employee Name is :" + this.EName); Console.WriteLine("Employee Color is :" + this.EColor); Console.WriteLine("Employee Qualification is :" + this.EQualification); Console.WriteLine("Employee Designation is :" + this.EDesignation); Console.WriteLine("Employee Age is :" + this.EAge); } } class ClassImpl { static void Main(string[] args) { Employee obj = new Employee(); obj.Get(); obj.Display(); Console.Read(); } }
Liked By
Write Answer
How to Implementation of Class in C#
Join MindStick Community
You have need login or register for voting of answers or question.
Anonymous User
21-Dec-2015When you define a class, you define a blueprint for a data type. This does not actually define any data, but it does define what the class name means. That is, what an object of the class consists of and what operations can be performed on that object. Objects are instances of a class. The methods and variables that constitute a class are called members of the class.