My task: read the two-dimensional byte array from the console. That he enrolled in the variable, and in the future I worked with him. I imagine it like this: the user enters the first line, presses Enter, the second, writes go and the array processing algorithm starts. Here is what I am trying:
public static byte[][] input(int strok, int stolb){ Scanner sc=new Scanner(System.in); byte X[][]=new byte[strok][stolb]; int i,j; for (i=0; i<strok; i++){ for (j=0; j<stolb; j++){ X[i][j]=sc.nextByte(); } } return X; } public static void main(String[] args) throws Exception { Scanner sc=new Scanner(System.in); System.out.print("Введите количество строк: "); int strok=sc.nextInt(); System.out.print("Введите количество столбцов: "); int stolb=sc.nextInt(); Table pokr1=new Table(input(strok,stolb)); pokr1.putArr();
main? write Maine code - Alexey Shimansky