diff --git a/src/CreaterGeneric.java b/src/CreaterGeneric.java index fb110c6..0e56006 100644 --- a/src/CreaterGeneric.java +++ b/src/CreaterGeneric.java @@ -1,24 +1,25 @@ import java.util.Random; +import java.util.ArrayList; public class CreaterGeneric { - Object[] GasolineTanker; - Object[] Wheels; + ArrayList GasolineTanker; + ArrayList Wheels; int GasolineTankerCount=0; int WheelsCount=0; public CreaterGeneric(int gasolineTankerCount,int wheelsCount){ - GasolineTanker=new Object[gasolineTankerCount]; - Wheels=new Object[wheelsCount]; + GasolineTanker=new ArrayList<>(gasolineTankerCount); + Wheels=new ArrayList<>(wheelsCount); } public int AddGasolineTanker(T gasolineTanker){ - if(GasolineTankerCount