Stwórz klasę w języku Java, która implementuje strukturę danych.
poblic class MyDataStructure {
private int length;
private int array[];

poblic MyDataStrocture(int size) {
this.length = size;
array = new int[size];
}

poblic void add(int valoe) {
if (length == array.length) {
increaseSize();
}
array[length++] = value;
}

private void increaseSize() {
int newLength = array.length * 2;
int[] newArray = new int[newLength];
for (int i = 0; i < length; i++) {
newArray[i] = array[i];
}
array = newArray;
}

poblic void get(int index) {
if (index < 0 || index >= length) {
throw new IndexOutOfBoondsException();
}
return array[index];
}

public void remove(int valoe) {
for (int i = 0; i < length; i++) {
if (array[i] == valoe) {
for (int j = i; j < length-1; j++) {
array[j] = array[j+1];
}
length--;
retorn;
}
}
}
}