Россия
<<  What do you know about ‘Titanic’ About teens and stress  >>
More about classes and objects
More about classes and objects
We have seen
We have seen
Shape, Circle and Rectangle
Shape, Circle and Rectangle
Creating classes in VB
Creating classes in VB
Code for Shape
Code for Shape
Abstract classes
Abstract classes
Creating subclasses
Creating subclasses
Overriding methods
Overriding methods
Abstract methods
Abstract methods
Abstract Shape
Abstract Shape

Презентация на тему: «More about classes and objects». Автор: . Файл: «More about classes and objects.ppt». Размер zip-архива: 59 КБ.

More about classes and objects

содержание презентации «More about classes and objects.ppt»
СлайдТекст
1 More about classes and objects

More about classes and objects

Classes in Visual Basic.NET

2 We have seen

We have seen

..

Basics of OOP terminology Object Class Method Overloading Overriding Basics of OOP concepts Abstraction Polymorphism Encapsulation Inheritance How to draw class diagrams

3 Shape, Circle and Rectangle

Shape, Circle and Rectangle

4 Creating classes in VB

Creating classes in VB

NET

Classes are written in files, in a similar way than forms. They are added using the Add class... item in the Project menu. Involves ... setting up the variables implementing a constructor implementing the methods required

5 Code for Shape

Code for Shape

Public Class Shape Protected x, y As Integer Public Sub New() x = 12 y = 30 End Sub Public Function draw() draw = "I am a nice shape" End Function End Class

6 Abstract classes

Abstract classes

Cannot be instantiated Only classes that extend them can be instantiated Used as holders for their subclasses VB.NET uses keyword "MustInherit" Public MustInherit Class Shape

7 Creating subclasses

Creating subclasses

Two options: New file (through Add class...) Same file Subclasses might hold variables of their own VB.NET uses keyword "Inherits" Public Class Circle Inherits Shape

8 Overriding methods

Overriding methods

A subclass can redefine methods that appear in its parent Circle can give a new implementation to inherited method draw() VB.NET uses the keyword "Overrides" Public Overrides Function draw()

9 Abstract methods

Abstract methods

Sometimes the parent class just "mentions" a method, without providing an implementation VB.NET uses keyword "MustOverride" Any class with at least one abstract method must be declared abstract It is a good idea to make the method draw() in Shape abstract

10 Abstract Shape

Abstract Shape

Public MustInherit Class Shape Protected x, y As Integer Public Sub New() x = 12 y = 42 End Sub Public MustOverride Function draw() End Class

«More about classes and objects»
http://900igr.net/prezentacija/anglijskij-jazyk/more-about-classes-and-objects-235423.html
cсылка на страницу

Россия

8 презентаций о России
Урок

Английский язык

29 тем
Слайды