Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ESOPAB4;
- public class AB1 {
- public static void main(String[] args) {
- int[][] a = {{1,2,3},{4,5,6},{7,8,9}};
- boolean[][] b = {{true,false},{false,false},{true,true},{false,true},{false,false},{true,false},{false,true}};
- char[][] c = {{'a','a','b','c','d','f','h'},{'s','c','b','c','g','k','z'},{'d','e','t','g','d','x','h'}};
- int[][] d = {{1,2,3,4},{5,6,7},{8,9},{1}};
- print2DArrayToScreen(a);
- System.out.println();
- print2DArrayToScreen(b);
- System.out.println();
- print2DArrayToScreen(c);
- System.out.println();
- print2DArrayToScreen(d);
- }
- static void print2DArrayToScreen(int[][] a){
- for (int[] x: a) {
- for (int out: x) {
- System.out.print(out +",");
- }
- System.out.println();
- }
- }
- static void print2DArrayToScreen(boolean[][] b) {
- for (boolean[] x: b) {
- for (boolean out: x) {
- System.out.print(out +",");
- }
- System.out.println();
- }
- }
- static void print2DArrayToScreen(char[][] c) {
- for (char[] x: c) {
- for (char out: x) {
- System.out.print(out +",");
- }
- System.out.println();
- }
- }
- }
Add Comment
Please, Sign In to add comment