as am new to Apex programming. Am learning the apex using developer console and want to take the user input using the execution window.I want to take user input for array with 25 elements. How can we fulfill this ? Can there be any other method except passing as argument in function?
-
1I believe you're probably asking the wrong question. What are you trying to accomplish?– sfdcfox ♦Commented Jan 15, 2017 at 17:26
-
i think the question is to take user input from developer console while using the 'execute anonymous window'. How can we take input from there for large number of data.– alekh sharmaCommented Jan 15, 2017 at 17:56
Add a comment
|
1 Answer
You can easily define methods or classes that take input.
public static Integer double(Integer x) { return 2 * x; }
public class MyClass
{
public void doStuff(String input)
{
// logic here
}
}
system.debug(double(21));
MyClass instance = new MyClass();
instance.doStuff('Some input');
You can specify up to 32 different parameters of any type.
public static void doStuff(List<Integer> dataType1, List<String> dataType2)
{
// do stuff
}
-
Thanks a lot! adrian . But if we require a large set of data like the input in matrix with around 12 to 18 values Commented Jan 15, 2017 at 17:02
-
What do you mean "the input in matrix". Your question isn't very clear or specific...– Adrian Larson ♦Commented Jan 15, 2017 at 17:03
-
I want to take input in array with large number of elements Commented Jan 15, 2017 at 17:06
-
-
Thanks a lot ! adrian ! i think i have got my answer now. Commented Jan 15, 2017 at 17:40