【发布时间】:2016-12-24 16:47:58
【问题描述】:
今天我需要一些帮助,将 4 个用户定义的字符串、2 个 int 和 4 个 double 变量作为一个索引添加到数组列表中。
例如:(我会为您减少一些变量,并记住 sc 是我的扫描仪对象,测试结果超出 100)
System.out.print("enter your name")
String name = sc.next();
System.out.print("enter your test results")
double results = sc.nextDouble();
System.out.print("enter your mobile number")
int mobile_num = sc.nextInt(); //I may change this to a string
现在,我想从这里捕获这些输入并将它们存储在数组中的数字 1 或用户名下。我也想知道如何通过上面提到的代码使用这个相同的数组来存储来自用户的无限输入。
提前致谢!
【问题讨论】: