From 89ab094b5b851f5af34af8ca825cb0c1dc6d302f Mon Sep 17 00:00:00 2001 From: Danila_Mochalov Date: Mon, 24 Oct 2022 10:58:46 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B6=D0=B5=D0=BD=D0=B5=D1=80=D0=B8?= =?UTF-8?q?=D0=BA=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=BC=D0=B0=D1=81=D1=81=D0=B8?= =?UTF-8?q?=D0=B2=D1=8B=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D1=8E=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D1=87=D1=83=D1=82=D1=8C=20=D0=B1=D0=BE=D0=BB=D0=B5?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D1=8C=D0=BD=D1=8B?= =?UTF-8?q?=D0=BC=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B7=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EntityWithExtraCreator.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/EntityWithExtraCreator.java b/EntityWithExtraCreator.java index 239ec49..04b6d65 100644 --- a/EntityWithExtraCreator.java +++ b/EntityWithExtraCreator.java @@ -1,15 +1,16 @@ +import java.lang.reflect.Array; import java.util.Random; public class EntityWithExtraCreator { - private EntityLocomotive[] entityArr; - private IDrawningExtra[] extraArr; + private T[] entityArr; + private U[] extraArr; int entitiesCount = 0; int extraCount = 0; public EntityWithExtraCreator(int countEntities, int countExtra) { - entityArr = new EntityLocomotive[countEntities]; - extraArr = new IDrawningExtra[countExtra]; + entityArr = (T[]) new EntityLocomotive[countEntities]; + extraArr = (U[]) new IDrawningExtra[countExtra]; } public int Insert(T entityLocomotive) {