Методы C#

C Sharp > Методы C#
18.01.2018 15:58:05


Наиболее часто встречающиеся слова в статье:

[statements] [classes] [abstract] [Derived] [Motorcycle] [StartEngine] [derived] [protected] [gallons] [override]


Статья:

abstract class Motorcycle
{
    // Anyone can call this. 
    public void StartEngine() {/* Method statements here */ }
 
    // Only derived classes can call this. 
    protected void AddGas(int gallons) { /* Method statements here */ }
 
    // Derived classes can override the base class implementation. 
    public virtual int Drive(int miles, int speed) { /* Method statements here */ return 1; }
 
    // Derived classes must implement this. 
    public abstract double GetTopSpeed(); 
}