Abstract classes, DOT NET Programming

Assignment Help:

What are abstract classes?

The features of the abstract class are as follows:-

1.     You can not create an object of the abstract class.

2.     The Abstract class is designed to act as a base class (to be inherited by another classes). In the program development  the Abstract class is a design concept and provides a base upon which other classes are built.

3.     The Abstract classes are similar to the interfaces. After declaring an abstract class, it can't be instantiated on its own, it must be inherited.

4.     In VB.NET abstract classes are created by using the "MustInherit" keyword.In the C# we have "Abstract" keyword.

5.     The Abstract classes can have implementation or pure abstract methods which must be implemented in the child class.

Public MustInherit Class ClsAbstract

' use the mustinherit class to declare the class as abstract

Public Function Add(ByVal intnum1 As Integer, ByVal intnum2 As

Integer) As Integer

Return intnum1 + intnum2

End Function

' left this seconf function to be completed by the inheriting class

Public MustOverride Function MultiplyNumber(ByVal intnum1 As

Integer, ByVal intnum2 As Integer) As Integer

End Class

Public Class ClsChild

Inherits ClsAbstract

' class child overrides the Multiplynumber function

Public Overrides Function MultiplyNumber(ByVal intnum1 As

Integer, ByVal intnum2 As Integer) As Integer

Return intnum1 * intnum2

End Function

End Class

1945_abstract classes.png


Related Discussions:- Abstract classes

Benefits & limitation of hidden fields, What are benefits & Limitation of  ...

What are benefits & Limitation of  Hidden fields? The benefits of using Hidden fields are as shown below :- 1)    They are very simple to implement. 2)    As the data is

Slide bettween window application, Slide Bettween Window Application 1 P...

Slide Bettween Window Application 1 Project Description: Like Mouse Gesture. Keep Right Mouse, Slide Left and drop right mouse. Move to earlier app on taskbar. Keep Lef

Payroll managment, how can i construct er diagram for payroll managment

how can i construct er diagram for payroll managment

Explain the dataadapter.update, Explain the DataAdapter.Update() and DataSe...

Explain the DataAdapter.Update() and DataSetAcceptChanges() methods. The DataAdapter.Update() method calls any of the DML statements, like UPDATE, INSERT, or DELETE statements,

Use of dispose method, What is the use of DISPOSE method? This Dispose ...

What is the use of DISPOSE method? This Dispose method belongs to the IDisposable interface. It is bad  to override the finalize method for writing the cleaning of the unmanage

Define cts, CTS(Common Type System) : In order that the two language commu...

CTS(Common Type System) : In order that the two language communicate smoothly CLR has CTS (Common Type System). Example in VB you have "Integer" and in C++ you have "long" these d

I want a c# school project, I want a C# school project Project Descripti...

I want a C# school project Project Description: The project is made in C# and haves a database connection. We have some small problems asking up data from the database.

.net remoting, What is .NET Remoting? The .NET remoting is replacement ...

What is .NET Remoting? The .NET remoting is replacement of DCOM. Using .NET remoting you can make remote object calls that lie on different Application Domains. since the remot

What is the appfabric component, What is the AppFabric component? The A...

What is the AppFabric component? The AppFabric component is used to make access control and dole out messages across clouds and enterprises. It has a service-oriented architect

Program for assigning the values to variables, Normal 0 false ...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd