Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Rechteck {
- public static boolean isRectangular(int[][] array) {
- boolean b = true;
- for (int i = 0; i < array.length; i++) {
- if (array[0].length == array[i].length) {
- } else b = false;
- }
- if (b == true)
- {
- for (int i = 0; i < array.length; i++) {
- for (int j = 0; j < array[i].length; j++) {
- System.out.print(array[i][j] + ", ");
- }
- System.out.println();
- }
- return true;
- } else {
- return false;
- }
- }
- public static void main(String[] args) {
- isRectangular(new int[3][4]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement