Java 配列 static, Main 【初心者】
解決したいこと
九九表を以下のプログラムコードをもとに作成したい
例)
Javaで九九表を出力するようプログラムをつくっています。
j のfor文以下の1文を直してプログラムが動くようにしたいのですが、そもそも上のMainの関係と下のstatic, prod()の部分があまり理解できておらずです。
参考コード
public class Main {
public static void main(String[] args) {
int[][] array = new int[9][9];
int i, j;
int temp;
for(i = 0; i < array.length; i++){
for(j = 0; j < array[i].length; j++){
#tempを定義する?;
}
System.out.println("\n");
}
}
public static void prod(int a, int b){
int temp = a * b;
System.out.print(temp + " ");
}
}
自分で試したこと
System.out....など試したのですが、うまくいきませんでした。
可能であれば上下のpublicで始まるコードの関係についてもご教示いただけますと幸いです。