public class exempel18
{
	public static void main(String args[])
	{	
		int antal, i;
		//HockyPlayer saku = new HockyPlayer();
	
		System.out.println("Hur manga spelare vill du registrera: ");
		antal = input.readInt(); 
		
		//dessa rader skaper en tabell som innhåller "antal" antal
		//objekt av klassen HokceyPlayer
		//------------------------------------------------
		HockyPlayer spelarTabb[] = new HockyPlayer[antal];
		
		for(i = 0; i < antal; i++) 
		{
			spelarTabb[i] = new HockyPlayer();
		}
		//------------------------------------------------
		
		for(i = 0; i < antal; i++)
		{
			System.out.println("\nSriv in namn spelarnummer och position for en ishockeyspelare: ");
			System.out.println("Spelare: " + (i + 1));
			System.out.println("-----------");
			spelarTabb[i].namn = input.readString();
			spelarTabb[i].nr = input.readInt();
			spelarTabb[i].position = input.readString();
		}
		
		System.out.println("\nHar e dina hockyspelare: ");

		for(i = 0; i < antal; i++)
		{
			System.out.println("Spelare: " + (i+1));
			System.out.println("-----------");	
			System.out.println("Namn: " + spelarTabb[i].namn);
			System.out.println("Namn: " + spelarTabb[i].nr);
			System.out.println("Namn: " + spelarTabb[i].position);
		}	
		
	}
}

class HockyPlayer
{
	String namn;
	int nr;
	String position;
}

