Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Implementation of Class in C#
WhatsApp
Sandeep Kumar
Dec 21
2015
938
0
1
Class.rar
Class Person
String PName, PColor, PQualification, PDesignation;
Int PAge;
Public
void
Get()
{
Console.WriteLine(
"Enter the person's Name,Color,Qualification,Designation and Age "
);
This.Pname = Console.ReadLine();
This.PColor = Console.ReadLine();
This.PQualification = Console.ReadLine();
This.PDesignation = Console.ReadLine();
This.PAge = Convert.ToInt32(Console.ReadLine());
}
Public
void
Display()
{
Console.WriteLine(
"Person Name is :"
+ This.PName);
Console.WriteLine(
"Person Color is :"
+ This.PColor);
Console.WriteLine(
"Person Qualification is :"
+ This.PQualification);
Console.WriteLine(
"Person Designation is :"
+ This.PDesignation);
Console.WriteLine(
"Person Age is :"
+ This.PAge);
}
Class ClassImpl
public
void
Main()
{
Person obj =
new
Person();
obj.Get();
obj.Display();
}
Console.Read();
}
Class Implementataion
Up Next
Implementation of Class in C#