IT SOLUTIONS
Your full service technology partner! 
+Expand
   ► KBTo/From GuidesDelphi Prism  Print This     

Base Class (Delphi Prism and VB.Net Cross Reference Guide)

By Mike Prestwood

Delphi Prism versus VB.Net: A side by side comparison between Delphi Prism and VB.Net.

 
OOP Basics
 

Some languages support object-based concepts such as Paradox, Access, and VB Classic. Other languages have OO extensions and fully support object orientation in a hybrid fashion (such as C++ and Dephi for Win32). Finally, some lanages such as C#, VB.Net, Prism, and Java are entirely written in OO. Meaning, every line of code written must occur within a class).

Base Class

[Other Languages] 

Languages Focus

When you create a class, it is either a base class or inherits from another class. Some languages require all classes to inherit from a common base class and some do not.

Delphi Prism:   System.Object

In Prism, the Object keyword is an alias for the base System.Object class and is the single base class all classes ultimately inherit from.

Syntax Example:  
//Specify both namespace and class:
Cyborg = class(System.Object)
end;
  
//Use Object keyword for System.Object.
Cyborg = class(Object)
end;
  
//When none, default is System.Object.
Cyborg = class
end;
VB.Net:   System.Object

In VB.Net, the Object keyword is an alias for the base System.Object class and is the single base class all classes ultimately inherit from. Use the Inherits keyword to indicate the parent class and Inherits must precede all declarations in a class.

Syntax Example:  
'Specify both namespace and class:
Public Class Cyborg
Inherits System.Object
End Class
  
'Use Object alias for System.Objct:
Public Class Cyborg
Inherits Object
End Class
  
'Default when not specified is System.Object:
Public Class Cyborg
End Class












Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2025 Prestwood IT Solutions.   [Security & Privacy]