package oop.Generics;

import java.util.ArrayList;

public class EinfachesBeispiel {
	

	
	public static void main(String[] args) {
		
	
		
		
		int[] intArray = {1,2,3,4,5};
		double[] doubleArray = {1.1,2.2,3.3,4.12,4.4};
		float[] floatArray = {1.1f,2.2f,3.3f,4.12f,4.4f};
		
		//auslesen(floatArray);
		
		// für Generic
		Integer[] IntegerArray = {1,2,3,4,5};
		Double[] DoubleArray = {1.1,2.2,3.3,4.12,4.4};
		Float[] FloatArray = {1.1f,2.2f,3.3f,4.12f,4.4f};
		Character[] characterArray = {'a','b','c'};
		String[] stringArray = {"hallo","Welt"};
		
		//auslesenGenerics(stringArray);
		
		
		var variable = 1.1;
		System.out.print(variable);
		
	}
	public static void auslesen(int[] array) {
		
		for (int i : array)
			System.out.print(i + " ");
	}
	
	public static void auslesen(double[] array) {
		
		for (double i : array)
			System.out.print(i + " ");
	}
	
	
	public static void auslesen(float[] array) {
		
		for (float i : array)
			System.out.print(i + " ");
	}
	
	// ich muss nicht immer die Mthode überladen wie oben die Methoden
	// ich schicke also eine Objekt an diese Methode
	public static <obj> void auslesenGenerics(obj[] array) {
		
		for (obj i : array)
			System.out.print(i + " ");
	}

}
