I'm trying to make a two dimensional array and output the results [3][3] in 3 lines and 3 colons, but I get it like 123456789 in a straight line. Now I know that I get this result because of the "println" command but I would like to know how can I get it work the way I want it to. Sorry, I'm new to programming.
import java.util.Scanner; public class klasa { public static Scanner lexo = new Scanner(System.in); public static void main(String[]args){ int[][] array = new int[3][3]; for(int a=0;a<3;a++){ for(int b=0;b<3;b++){ System.out.println("Shkruaj numrat: "); array[a][b]= lexo.nextInt(); } } for(int a =0; a<3;a++){ for(int b=0;b<3;b++){ System.out.println(array[a][b]); } } } }