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?

  • 1
    I believe you're probably asking the wrong question. What are you trying to accomplish?
    – sfdcfox
    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. Jan 15, 2017 at 17:56

1 Answer 1


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

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 Jan 15, 2017 at 17:02
  • What do you mean "the input in matrix". Your question isn't very clear or specific...
    – Adrian Larson
    Jan 15, 2017 at 17:03
  • I want to take input in array with large number of elements Jan 15, 2017 at 17:06
  • So just change the parameter type...
    – Adrian Larson
    Jan 15, 2017 at 17:11
  • Thanks a lot ! adrian ! i think i have got my answer now. Jan 15, 2017 at 17:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .