【问题标题】:I keep getting this "Syntax error on token "(", ; expected after this token" error?我不断收到此“令牌上的语法错误”(“,;预期在此令牌之后”错误?
【发布时间】:2017-09-22 23:30:54
【问题描述】:
package mathtable;

public class tablefmath {

public static void main(String[] args) {
    // TODO Auto-generated method stub

    final int jMax = 10;
    final int iMax = 15;
    int column=1, row=1;

    System.out.println(" " + "  |  ");

    for (column<=jMax; column++) {
        System.out.println(column + "\t");
    }           
}
}

这是我的代码。我想完成一个乘法表。我知道怎么做,但我的 for 循环有语法错误?

【问题讨论】:

    标签: java for-loop syntax


    【解决方案1】:

    怎么样

    for (; column<=jMax; column++){
    

    您在 for 循环中跳过了 ;。它应该包含三个组件。

    【讨论】:

    • 它部分工作。我需要看起来像这样:1 2 3 4 5... 以此类推,但它只是跳过行
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-30
    • 1970-01-01
    • 2013-07-16
    • 1970-01-01
    相关资源
    最近更新 更多