I've looked everywhere and I haven't found anything related to initializing an array in a class constructor.
This is the class I'm trying to create:
public Sandwich(char b, String m, String c, String[] e)
{
setBread( b );
setMeat( m );
setCheese( c );
setExtras( e );
}
This is my attempt at initializing the array:
public static void main(String[] args)
{
Sandwich[] order;
order = new Sandwich[3];
order[0] = new Sandwich('s', "pastrami", "swiss", extras[2] = {"mayo", "extra meat"} )
order[1] = new Sandwich();
}
I am at a loss.