about the class not about the specific objects of the class. A static property is accessed not with instance name but after class name it self. We will demonstrate it with a example First lets make a class of student with needed properties, and make a constructor. Now let’s add static attribute as below:
are the methods of the class not method of instances. To create a static method just add static keyword in the method. Static method is directly accesses like static attribute. Static Class is a class of which we cannot create new instances.] They are extremely useful. Normally, static classes are used to include useful methods. For Eg: Math is a static class and we cannot create instance of Math class.
we can inherit all the properties and functions of one class to another. Suppose we have a Person class with methods like Walks(), Sleeps() and Eat(). Now let’s make a student class, and we know that a student is also a person. Here Inheritance comes in to hand. We can inherit properties and methods of Person class to Student Class by which Student class can access methods like Walks(), Sleeps() To inherit we just use : after the Student class and write Person. Similarly, we con override some methods of Person class also. To do this just add virtual keyword to the required method. Now in Student class just use override for that same method and you can now change the property of Person class.