我正在尝试编写一些代码来打印出由'*'组成的正方形。问题是我在变量“int stars”之后收到一条错误消息“.class expected”。我不确定这意味着什么。
class Main
{
public static void main( String args[] )
{
int sqaure = 5;
int line = 1;
while ( line <= sqaure )
int stars = 1;
while ( stars <= square )
{
System.out.print( "*" );
stars = stars + 1;
}
System.out.println();
line = line + 1;
}
}