为什么我收到此错误“这(10)”,即使第一条语句是一个构造函数调用。我正在使用eclipse。Eclipse的:构造函数调用必须是第一条语句
public class MaxIndependentSet {
private ArrayList<Integer> inputArr = new ArrayList<Integer>();
public void MaxIndependentSet(int size) {
inputArr.ensureCapacity(size);
}
public void MaxIndependentSet() {
this(10);
}
}
哎呀我的坏。我想知道我的大脑是如何工作的,每天处理java代码,并且仍然盯着这一段时间,但却没有注意到这样一个愚蠢的事情。谢谢。 –