What is class in c#?

Asked 6 years ago Updated 6 years ago | 10/23/2019 1:02:44 AM 884 views

1 Answer


0
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
                    }

Write Your Answer