public class TwodimensionDemo2 {public static void main(String[] args) {//创建二维数组来存储数据int [][]yearArrArr={{22,66,44},{77,33,88},{25,45,65},{11,66,99}};int yearSum=0;//遍历二维数组,得到每一个一维数组并求和for (int i = 0; i < yearArrArr.length ; i++) {int[]quarterArr=yearArrArr[i];int sum= getsum(quarterArr);System.out.println("第"+(i+1)+"季度的营业额为:"+sum);yearSum=yearSum+sum;}System.out.println("四个季度的总营业为"+yearSum);}//定义一个方法,计算每一个季度的营业额public static int getsum(int[] arr){int sum=0;for(int i=0;i<arr.length;i++){sum+=arr[i];}return sum;} }