 Créez une classe en Java qui implémente une structure de données.
public class MyDataStructure {\n private int length;\n private int array[];\n \n public MyDataStructure(int size) {\n this.length = size;\n array = new int[size];\n } \n \n public void add(int value) {\n if (length == array.length) {\n augmentSize();\n }\n array[length++] = value;\n }\n \n private void augmentSize() {\n int newLength = array.length * 2;\n int[] newArray = new int[newLength];\n for (int i = 0; i < length; i++) {\n newArray[i ] = array[i] ;\n }\n array = newArray ;\n }\n \n public void get(int index) {\n if (index < 0 || index >= length) {\n throw new IndexOutOfBoundsException();\n }\n return array[index];\n }\n \n public void remove(int value) {\n for (int i = 0; i < length; i++) {\n if ( array[i] == value) {\n for (int j = i; j < length-1; j++) {\n array[j] = array[j+1];\n }\n length--; \n retour ;\n }\n }\n }\n}