Take different values from a String and convert them to Double Values

后端 未结 5 786
孤街浪徒
孤街浪徒 2021-01-27 09:10

In my code, I\'m asking the user to input three different values divided by a blank space. Then, those three different values I would like to assign them to three different

5条回答
  •  梦谈多话
    2021-01-27 09:39

    1. Take input from user.

    2. split that line using delimeter space i.e " ".

    3. inside for loop change each index element to double.By using Double.parseDouble(splitted[i]);

提交回复
热议问题