你可以使用嵌套循环来打印九九乘法表,具体代码如下:
public class MultiplicationTable {
public static void main(String[] args) {
int size = 9;
for (int i = 1; i <= size; i++) {
for (int j = 1; j <= i; j++) {
int product = i * j;
System.out.print(j + " * " + i + " = " + product + "\t");
}
System.out.println();
}
}
}
运行以上代码,将会输出九九乘法表。