Question: just write a generic code for the following methods in java language. class Array{ int[] array; int n; int N; //make a default constructor to
just write a generic code for the following methods in java language.

![class Array{ int[] array; int n; int N; //make a default constructor](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3d61201dda_08166f3d61191b8a.jpg)
class Array{ int[] array; int n; int N; //make a default constructor to create an array of name array with 10 elements //make a parameterized constructor to create an array of name array with N elements boolean addAtIndex(int val, int index) { //add code return true; } boolean addAtStart(int val){ //add code return true; } boolean addAtEnd(int val){ //add code return true; } int deleteAtEnd() { //add code return 0; } int deleteAtStart(){ //add code return 0; } int deleteAtIndex(int index) { //add code return 0; } int getByIndex(int index) { //add code return 0; } int search(int key){ //add code return -1; } int binarySearch(int key) { return -1; } void Sort(){ } void printArray(){ //add code }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
