Code: Inheriting from a Class (Visual Basic)
This example defines the Circle and Rectangle classes, which both inherit from the Shape class, and the Square class, which inherits from the Rectangle class.
Example
- Код: Выделить всё
Public Class Shape
' Definitions of properties, methods, fields, and events.
End Class
Public Class Circle : Inherits Shape
' Specialized properties, methods, fields, events for Circle.
End Class
Public Class Rectangle : Inherits Shape
' Specialized properties, methods, fields, events for Rectangle.
End Class
Public Class Square : Inherits Rectangle
' Specialized properties, methods, fields, events for Square.
End Class
GB826 писал(а)::oops: Объясните на простом примере, как создать класс наследник?
Сейчас этот форум просматривают: AhrefsBot, Google-бот и гости: 47