Eclipse说:'chiffres无法解析为变量',如何修复调用方法?
public class Table {
public static void main(String[] args) {
Tableau1 table = new Tableau1();
table.CreerTable();
table.AfficherTable(chiffres);
}}
Run Code Online (Sandbox Code Playgroud)
part:和类Tableau1 with array:声明它
public class Tableau1 {
int [][] chiffres;
int nombre;
public void CreerTable(){
int[][] chiffres= {{11,01,3},
{12,02,4},
{12,03,5}};
//edited
this.chiffres=chiffres;
}
public int[][] AfficherTable(int[][] chiffres){
this.nombre=12;
for(int i=0;i<2;i++){
System.out.println("essai"+chiffres[i][1]);
if(chiffres[i][0]==nombre){System.out.println("ma ligne ="+chiffres[i][0]+","+chiffres[i][1]+","+chiffres[i][2]);
};
}
return chiffres;
}
Run Code Online (Sandbox Code Playgroud)
}
非常感谢