public class GenerickaMetoda { // genericka methoda tiskPole public static < E > void tiskPole( E[] inputArray ) { // zobraz prvky pole for ( E element : inputArray ) System.out.printf( "%s ", element ); System.out.println(); } // end methody tiskPole public static void main( String args[] ) { // vytvor pole Integer, Double a Char Integer[] intArray = { 1, 2, 3, 4, 5, 6 }; Double[] doubleArray = { 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7 }; Character[] charArray = { 'A', 'H', 'O', 'J' }; System.out.println( "\nPole integerArray obsahuje:" ); tiskPole( intArray ); // preda Integer pole System.out.println( "\nPole doubleArray obsahuje:" ); tiskPole( doubleArray ); // preda Double pole System.out.println( "\nPole characterArray obsahuje:" ); tiskPole( charArray ); // preda pole znaku } // end main } // end class GenerickaMetoda