package com.javarush.task.task15.task1507; //Now I have told you before it happens so that, when it happens, you may believe (John 14:29) /* ООП - Перегрузка */ public class Solution { public static void main(String[] args) { printMatrix(2, 3, "8"); } public static void printMatrix(int m, int n, double value) { System.out.println("Заполняем объектами double"); printMatrix(m, n, (Object) value); } public static void printMatrix(int m, int n, float value) { System.out.println("Заполняем объектами float"); printMatrix(m, n, (Object) value); } public static void printMatrix(int m, int n, short value) { System.out.println("Заполняем объектами short"); printMatrix(m, n, (Object) value); } public static void printMatrix(int m, int n, byte value) { System.out.println("Заполняем объектами byte"); printMatrix(m, n, (Object) value); } public static void printMatrix(int m, int n, int value) { System.out.println("Заполняем объектами int"); printMatrix(m, n, (Object) value); } public static void printMatrix(int m, int n, Integer value) { System.out.println("Заполняем объектами Integer"); printMatrix(m, n, (Object) value); } public static void printMatrix(int m, int n, char value) { System.out.println("Заполняем объектами char"); printMatrix(m, n, (Object) value); } public static void printMatrix(int m, int n, long value) { System.out.println("Заполняем объектами long"); printMatrix(m, n, (Object) value); } public static void printMatrix(int m, int n, String value) { System.out.println("Заполняем объектами String"); printMatrix(m, n, (Object) value); } public static void printMatrix(int m, int n, Object value) { for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { System.out.print(value); } System.out.println(); } } } /* ООП - Перегрузка Перегрузите метод printMatrix 8 различными способами. В итоге должно получиться 10 различных методов printMatrix. Требования: 1. В классе Solution должны быть реализованы 10 методов printMatrix с различными аргументами. 2. Класс Solution должен быть public. 3. Все методы класса Solution должны быть статическими. 4. Все методы класса Solution должны быть публичными. package com.javarush.task.task15.task1507; * ООП - Перегрузка * public class Solution { public static void main(String[] args) { printMatrix(2, 3, "8"); } public static void printMatrix(int m, int n, String value) { System.out.println("Заполняем объектами String"); printMatrix(m, n, (Object) value); } public static void printMatrix(int m, int n, Object value) { for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { System.out.print(value); } System.out.println(); } } } */