hi so fare i have this but it doesnt seem to be working:
in one class i have:
and then in another class i want to call arrayA:Code :public class siwtchMenu{ public String[][] arrayA(int x, int y){ String arrayTest[][] = {{"0", "1", "2"},{"0","1", "2"}}; return arrayTest[x][y]; //error is here } }
Code :public class case1{ void case1(){ switchMenu obj = new switchMenu(); System.out.println("Array is:"); for(int i=0; i<3; i++){ System.out.println(obj.arrayTest[i][i]+ ", "); } } }
when i do this it comes up with an error (at error is here) saying:
Please help me on this as i have know idea what im doing wrong!Quote:
incompatible types
required: java.lang.String[][]
found: java.lang.String
thanks in advance! =]
