IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesDelphi  Print This     

Base Class

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:   TObject

In Delphi programming language (Object Pascal), all classes ultimately inherit from the base class TObject.

Syntax Example:
//Specify both namespace and class:
TCyborg = class(System.TObject)
end;
  
//Use shortcut alias:
TCyborg = class(TObject)
end;
  
//None, default is System.TObject
TCyborg = class
end;




Cross Reference Examples:

Access VBA:   Not Supported
ASP Classic:   Not Supported
C#:   System.Object

In C#, 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:
public class Cyborg : System.Object 
{ }
  
//Use shortcut alias:
public class Cyborg : Object 
{ }
  
//None, default is System.Object
public class Cyborg
{ }
C++/CLI:   System::Object

In C++/CLI, the Object keyword is an alias for the base System::Object class and is the single base class all classes ultimately inherit from.

More Info / Comment
Corel Paradox:   Not Supported
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;
Java:   Object

The Object class is Java's single base class all classes ultimately inherit from.

Syntax Example:
public class Cyborg {
}

or you can specify the base class (or any other class):

public class Cyborg extends Object {
}
JavaScript:   Not Supported
VB Classic:   Not Supported
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-2024 Prestwood IT Solutions.   [Security & Privacy]