Abstract - Virtual - Static

From TRCCompSci - AQA Computer Science
Revision as of 21:09, 16 December 2016 by Admin (talk | contribs)
Jump to: navigation, search

Static

The "static" modifier means that a class cannot be instantiated, and the subroutines must instead be called directly.

if you had a class of human and created an instance of the human called wayne, the static modifier doesn't allow access such as wayne.example() , or wayne.example = 5, or Console.WriteLine(wayne.example). They are not avialable in an instance of a class.

Abstraction

The "abstract" modifier when declaring a class means that the class contains one or more abstract subroutine, and must have one or more subclasses for implementations of abstract methods. A subclass of an abstract class that is instantiated must implement any abstract subroutines contained in the abstract class.

Virtual

A virtual method is one which is inheritable and can be overridden.