I.T. Discussion Community!
-Collapse +Expand
VB.Net
Search VB.Net Group:

Advanced
-Collapse +Expand VB.Net To/From
To/FromCODEGuides
-Collapse +Expand VB.Net Store
PRESTWOODSTORE

Prestwood eMagazine

May Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingVB.NetOOP   Print This     
  From the December 2014 Issue of Prestwood eMag
 
VB.Net OOP:
VB.Net Base Class (System.Object)
 
Posted 11 years ago on 10/24/2008 and updated 1/19/2009
VB.Net Code Snippet:
 A flashcard from our VB.Net Flashcards Library
 A code snippet from our VB.Net Code Snippets Page
 Tags: VB.Net , Base Class

KB101414



Languages Focus: Base Class

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.

VB.Net Base Class

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

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1235A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile


Linked Certification Question(s)

The following are practice certification questions with answers highlighted. These questions were prepared by Mike Prestwood and are intended to stress an important aspect of this KB post. All our practice questions are intended to prepare you generally for passing any certification test as well as prepare you for professional work.

Intermediate

1 Intermediate Level Question

Question #1: Multiple Choice

Given these 3 lines of code:

'1.
Public Class Cyborg
Inherits System.Object
End Class
  
'2.  
Public Class Cyborg
Inherits Object
End Class
  
'3.
Public Class Cyborg
End Class

Which of the following statements is most accurate?

Answer:
1. 

1 and 2 are equivalent.

2. 

1 and 3 are equivalent.

3. 

2 and 3 are equivalent.

4. 

All of the above. All three are equivalent.

5. 

None of the above. All three are not equivalent.


 KB Article #101414 Counter
10767
Since 10/24/2008
Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech