我尝试编译这个字符串:
public class Dimensions
{
public static void main( String[] args )
{
boolean[][] points = new boolean[5][20] ;
points[0][5] = true ;
points[1][6] = true ;
points[2][7] = true ;
points[3][8] = true ;
points[4][9] = true ;
for ( int i = 0 ; i < points.length ; i++ )
{
System.out.println( "\n" ) ;
}
for ( int j = 0 ; j < points.length ; j++)
{
char mark = ( points[i][j] ) ? 'X' : '-' ;
System.out.println( mark ) ;
}
}
}
但是javac给了我错误
Dimensions.java:17:错误:找不到符号 char mark = ( points[i][j] ) ?'X' : '-' ; ^ 符号:变量 i 位置:类维度 1 错误
它i
甚至不存在。提前致谢