Question: How do I change my 2D arrays to array lists? This is the code I have: import java.util.Scanner; import java.text.DecimalFormat; class BattingAverageApp{ public static void
How do I change my 2D arrays to array lists? This is the code I have:
import java.util.Scanner; import java.text.DecimalFormat; class BattingAverageApp{ public static void main(String []arg){ Scanner sc = new Scanner(System.in); System.out.println("Welcome to the Batting Average Calculator. "); while(true){ System.out.print("Enter the number of batters: "); int n = sc.nextInt(); System.out.println(" 0 = out, 1 = single, 2 = double, 3 = triple, 4 = home run"); int [][]batterScore = new int[n][3]; for(int i=0;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
