What is class in c#?

0 votes
55 views
Pradeep kumar Patel asked 23-Oct-2019 in Programming Language by Pradeep kumar Patel
edited 23-Oct-2019 by Pradeep kumar-Patel

What is class in c#?

    

1 Answer

0 votes
Pradeep kumar Patel answered 24-Oct-2019 by Pradeep kumar Patel
When you define a class then you define a blueprint for a data type. A class describes these things like data such as fields, methods, properties, members, and events in to a single unit. And in most cases, when you create an instance of that class, now referred to as an object. The class is actually a group of similar objects and logical data.
Let's see an example of C# class that has two fields only.
               public class Student  

                  {
                  int id;//field or data member
                  String name;//field or data member
                    }