开发者

Difference between Private Sub, Function and Class

开发者 https://www.devze.com 2023-01-22 23:00 出处:网络
What are the differences between the following: Private Sub Private Function Private Class When should each one开发者_开发知识库 be used?Private is a modifier than gives the scope of the class, s

What are the differences between the following:

  • Private Sub
  • Private Function
  • Private Class

When should each one开发者_开发知识库 be used?


Private is a modifier than gives the scope of the class, sub, or function.

A sub and a function are both subroutines, or sections of code that can be called in the program. The difference between them is that a function has a return value and a sub does not.

A class is a group of code that can include subs, functions, and other stuff.


Sub is like a function but it doesnt returns any values it just executes a proccess


Class is a Class, Sub and Function are methods, private is an access modifier

now check this link,

http://msdn.microsoft.com/en-us/library/ms973814.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消