function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RytomRytom 

APEX Methods - varying number of parameters

Is there a way to specify for a Method that it could have a varying number of parameters? 

 

In java you can specify a method has varying number of parameters through: 

 

public double Method_1 (double...parameter) { 

 

I was wondering if there's a similar thing availabile in APEX. 

 

Thanks! 

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox
No, but you can send in an array, even an array of objects (Object[]), which would allow you to merge any arrangement of elements.