Difference between Private Sub, Function and Class

时光毁灭记忆、已成空白 提交于 2019-11-30 10:58:24

问题


What are the differences between the following:

  • Private Sub
  • Private Function
  • Private Class

When should each one be used?


回答1:


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 codes that can include subs, functions, and other stuff.




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/4059537/difference-between-private-sub-function-and-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!