Posted By

mordecaix7 on 12/10/08


Tagged


Versions (?)

Shared Class With No Need for New Instances


 / Published in: VB.NET
 

Use this method to create a class that doesn't need to be declared new to return properties

  1. public class BuddyClass
  2. public shared Age as integer = 99
  3.  
  4. public shared function IsAlive() as boolean
  5. return true
  6. end function
  7. end Class
  8.  
  9.  
  10. can use this class like this:
  11. BuddyClass.Age
  12. BuddyClass.IsAlive
  13.  
  14. no need to do:
  15. new BuddyClass

Report this snippet  

You need to login to post a comment.