Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package spring.pkg18;
- public class twoDarray {
- public static void main(String[] args) {
- int[][] number=new int[2][3];
- int[][] number2=new int[2][3];
- number[0][0]=10;
- number[0][1]=20;
- number[0][2]=30;
- number[1][0]=40;
- number[1][1]=50;
- number[1][2]=60;
- //Second Matrix.
- number2[0][0]=10;
- number2[0][1]=20;
- number2[0][2]=30;
- number2[1][0]=40;
- number2[1][1]=50;
- number2[1][2]=60;
- System.out.println("Addition of [0][0]= "+(number[0][0]+number2[0][0]));
- System.out.println("Addition of [0][1]= "+(number[0][1]+number2[0][1]));
- System.out.println("Addition of [0][2]= "+(number[0][2]+number2[0][2]));
- System.out.println("Addition of [1][0]= "+(number[1][0]+number2[1][0]));
- System.out.println("Addition of [1][1]= "+(number[1][1]+number2[1][1]));
- System.out.println("Addition of [1][2]= "+(number[1][2]+number2[1][2]));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement