简体   繁体   中英

Store user input in array

Hello all I am in need of some help with getting a users input with double[] getUserInput().

I know how to get a users input and storing it, but I do not know how to do it with a array and I have to use double[] getUserInput(). Can someone explain to me how to set this particular code up " double[] getUserInput() ", and what it does?

I'm supposed to Store the user provided values into an array of doubles, and return this array to the main method.

Sample code to return double array

    public double[] getUserInput(){
       double[] userinput = {/*double values separated by comma*/};
       return userinput;
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM