小弟特请各位JAVA大神,帮帮解疑,感激不尽!为什么下面这段代码输出内容为6个*字符,而不是12个呢?
publicclasstest{publicstaticvoidmain(String[]args){finalintsize=4;for(inti=1;i<=size;...
public class test {
public static void main(String[] args) {
final int size = 4;
for (int i = 1; i <= size; i++) {
for (int j = i; j < size; j++) {
System.out.print("*");
}
}
}
} 展开
public static void main(String[] args) {
final int size = 4;
for (int i = 1; i <= size; i++) {
for (int j = i; j < size; j++) {
System.out.print("*");
}
}
}
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询