Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Help write a java program, define a plastic two-dimensional array with 2 rows and 3 columns, and assign a random integer of 0- 100 to each element in the array.
Help write a java program, define a plastic two-dimensional array with 2 rows and 3 columns, and assign a random integer of 0- 100 to each element in the array.
Parcel? com . pzr . demo;

Import? Java . util . array;

Public? Class? Demo6? {

Public? Static electricity Invalid? main(String[]? args)? {

int[][]? Data? =? New? int[2][3];

//assignment

for(int? Me? =? 0? ; ? Me? & lt? 2? ; ? i++){

for(int? j? =0? ; ? j & lt3? ; j++){

data[i][j]? =? (int)? (math . random()* 100);

}

}

//print

for(int? Me? =? 0? ; ? Me? & lt? 2? ; ? i++){

system . out . println(arrays . tostring(data[I]));

}

//Sort and print

for(int? Me? =? 0? ; ? Me? & lt? 2? ; ? i++){

//sort

arrays . sort(data[I]);

System.out.println ("the first one after row sorting"+(I+1)+");

system . out . println(arrays . tostring(data[I]));

}

}

} ask questions.