我无法获得公共代码构造函数的正确语法。因此,这是主要的:正确的语法
public class Main_code {
public static void main(String[] args) {
Code C = new Code;
C.code();
C.make();
}
}
这是市民代码:
public class code {
int x;
int numbers;
int [] result;
这是构造:
public code(){
this.x=0;
this.numbers [] = {6, 3, 8, 9, 1, 4, 7};
this.result= new int[x];
}
最后,这是无效:
public void make(){
for (int i=0; i<numbers.lenght){
if(this.numbers[i]<5){
this.result [x] = this.numbers[i]
}
}
for (int e=0; e<this.result.length;e++){
System.out.println (this.result[e]);
}
}
向我们显示您收到的错误消息。告诉我们你的想法是什么意思。 – pamphlet 2014-09-04 21:30:24
“大写的C代码应该是小写的”代码“吗?因为它们是不同的标识符 – khelwood 2014-09-04 21:34:15