hi,
again there is something wrong with my code it comes it with and error and highlights lottoticket.add(new Numbers());
no suitable method found for add(numbers)
import java.util.ArrayList;
/**
* lucky dip lottery ticket system.
*
* @author (Daniel Prempeh)
* @version 1.1 2013
*/
public class Ticket
{
//array list store instances of number class
private ArrayList<Numbers[]> lottoticket;
private int qty = 6;
public Ticket(int qty)
{
lottoticket = new ArrayList<Numbers[]>();
//needs a loop
for(int i=6; i<qty; i++)
{
lottoticket.add(new Numbers());
}
}
//print out ticket
public void printTicket()
{
//printout header of ticket
System.out.println("****************************** ");
System.out.println("** **");
System.out.println("** Ticket **");
System.out.println("** **");
System.out.println("****************************** ");
//code
//for loop
for(int i=6; i<qty; i++)
{
lottoticket.get(0).print();
}
//printout footer of ticket
System.out.println("** **");
System.out.println("****************************** ");
}
}