Advertisement
shawonrog

TwoDarray

Feb 19th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1.  
  2. package spring.pkg18;
  3.  
  4.  
  5. public class twoDarray {
  6. public static void main(String[] args) {
  7. int[][] number=new int[2][3];
  8. int[][] number2=new int[2][3];
  9. number[0][0]=10;
  10. number[0][1]=20;
  11. number[0][2]=30;
  12. number[1][0]=40;
  13. number[1][1]=50;
  14. number[1][2]=60;
  15. //Second Matrix.
  16. number2[0][0]=10;
  17. number2[0][1]=20;
  18. number2[0][2]=30;
  19. number2[1][0]=40;
  20. number2[1][1]=50;
  21. number2[1][2]=60;
  22.  
  23. System.out.println("Addition of [0][0]= "+(number[0][0]+number2[0][0]));
  24. System.out.println("Addition of [0][1]= "+(number[0][1]+number2[0][1]));
  25. System.out.println("Addition of [0][2]= "+(number[0][2]+number2[0][2]));
  26. System.out.println("Addition of [1][0]= "+(number[1][0]+number2[1][0]));
  27. System.out.println("Addition of [1][1]= "+(number[1][1]+number2[1][1]));
  28. System.out.println("Addition of [1][2]= "+(number[1][2]+number2[1][2]));
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement