我無法獲得公共代碼構造函數的正確語法。因此,這是主要的:正確的語法
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