Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

Write a complete Java class that will create a 2D array of randomly

Write a complete Java class that will create a 2D array of randomly

generated ints with dimensions of 5 rows and 10 columns. Print the values of each cell to a 5×10 table.
(Note: a complete Java class means the code should compile and run without issue. Be sure the output displays a set of random ints formatted in 5 rows by 10 columns.
My program is attached:

import java.uTl.Random;public class Array_2D {int [][] nums;public Array_2D() {Random r=new Random(10);nums = new int[5][10];for(int i=0;i<5;i++){for(int j=0;j<10;j++){nums[i][j]=(int)r.nextInt(10);}}}public void display(){for(int i=0;i<5;i++){for(int j=0;j<10;j++){System.out.print(nums[i][j]+” “);}System.out.println(“”);}}
Background image of page 1
public staTc void main(String[] args) {Array_2D s=new Array_2D();s.display();}}
Background image of page 2

Step-

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"