You need to sign in to do that
Don't have an account?
Suresh Raghuram
difference between void and non void method
hi i am always doing wrong with void and non void method i am not understanding when , where and how these methods are used , could any body explain in detail
It is required deppending on your application.
You have many ways to do the samething, but in some cases, you need to use a non-void method to reach your goal.
Normally, you have to use non-void in action buttons (for visualforce) and get methods (this MUST return the variable value, or they don't need to exist).
You should read a little bit about Object Oriented Programming.
All Answers
It is required deppending on your application.
You have many ways to do the samething, but in some cases, you need to use a non-void method to reach your goal.
Normally, you have to use non-void in action buttons (for visualforce) and get methods (this MUST return the variable value, or they don't need to exist).
You should read a little bit about Object Oriented Programming.
Generally, you youse non-void methods when you need to get something from the object.
In this case, we are passing a set of ids into this method because we need to get associated accounts with those ids.
In this instance, we just need to do an action upon something but we dont need to return the results to the caller.
Hopefully these simple examples explain. It might be a good idea to do like eric.luis said and read more about OOP.