function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
public class MethodOverloading { public static Integer sum(Integer one, Integer two){ return one+two; } public static Integer sum(Integer one, Integer two, Integer three){ return one+two+three; } public static Integer sum(Integer one, Integer two, String str){ System.debug(str); return one+two; } }
Integer sum1 = MethodOverloading.sum(10, 15); Integer sum2 = MethodOverloading.sum(10, 15, 17); Integer sum3 = MethodOverloading.sum(10, 15, 'Sum Calculated'); System.debug(sum1); System.debug(sum2); System.debug(sum3);
Yes, you can do that something like below:
The above methods can be called like below:
Please mark this as best answer if this answers your query.
Check my online presence here:
My Blog: http://sfdcfacts.com/
Youtube Channel: https://www.youtube.com/SFDCFacts
LinkedIn: https://www.linkedin.com/in/manish-choudhary/
Trailhead: https://trailhead.salesforce.com/en/me/manish-choudhari
Twitter: https://mobile.twitter.com/manish_sfdc