[英]ArrayList add Elements
I'm a absolute beginner in Java and I searched for half an hour, but I just can't figure out why the following code won't compile:我是 Java 的绝对初学者,我搜索了半个小时,但我无法弄清楚为什么以下代码无法编译:
public class Main {
ArrayList<Integer> path = new ArrayList<Integer>();
path.add(0);
path.add(1);
Out.print(path);
}
Thank you very much.非常感谢。
Please try the below specified snippet:请尝试以下指定的片段:
import java.util.ArrayList;
public class TestString {
public static void main(String[] args){
ArrayList<Integer> path = new ArrayList<Integer>();
path.add(0);
path.add(1);
System.out.print(path);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.