Just want to confirm if Salesforce Apex don't support parameters like Java and other languages?
For example:
It's a simple function with parameters in Java. And, Salesforce Apex DO NOT support such kind of syntax. Am I right?
public int mult(int x, int y)
{
return x * y;
}
Salesforce can pass parameters from Javascript or Visualforce Page to Apex, however, I never see parameters within function/class in Apex language so just want to make sure it. If Salesforce have function and parameters then we can write apex code more with efficient structure.
Added by 2012-12-18 ===========================
Thanks Gerard Sexton, it works.
Sample codes:
public class MyClass { public integer mult(integer x, integer y) { return x * y; } } MyClass m = new MyClass(); System.debug(m.mult(3,4));
The result is 12.