diff --git a/src/CreaterGeneric.java b/src/CreaterGeneric.java index c1c3f43..692c0c7 100644 --- a/src/CreaterGeneric.java +++ b/src/CreaterGeneric.java @@ -1,25 +1,26 @@ +import java.util.ArrayList; import java.util.Random; public class CreaterGeneric { - Object[] Warships; - Object[] Blocks; + ArrayList Warships; + ArrayList Blocks; int WarshipsCount=0; int BlocksCount=0; public CreaterGeneric(int warshipsCount,int blocksCount){ - Warships=new Object[warshipsCount]; - Blocks=new Object[blocksCount]; + Warships=new ArrayList<>(warshipsCount); + Blocks=new ArrayList<>(blocksCount); } public int AddWarship(T warship){ - if(WarshipsCount