public class MultipleDemo
{
public static void main(String[] args)
{
final int num = 9; //Define an integer constant to facilitate modifying the multiplication table that outputs n*n;
for(int i=1;i<=num;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print(j+"*"+i+ "="+i*j+"\t");
}
System.out.println();
}
}
}
Save the program as MultipleDemo.java, then compile and execute it; if you want to print a 4*4 multiplication table, just add the code
Change the value of num to 4.