I have to make a program that takes a user input and multiples it and stores the product in a matrix

import java.util.Scanner;

public class Tests {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

String inputString;

char flag = 'y';

while(flag != 'q' && flag != 'Q') {

System.out.print("Enter a positive integer:");

int value=input.nextInt ();

System.out.printf("Enter q to quit or any other key to quit: ");

input.nextLine();

inputString = input.nextLine();

flag = inputString.charAt(0);
}
}
}

This is the code i have so far. What the program needs to do is take the user input and multiply it and store the product in a matrix. For example if the user enters 3 the matrix needs to be 3x3 and have the product of 1 multiplied by 1, 1 multiplied by 2 and 1 multiplied by 3. Then do the same thing for 2 and 3.