Isn't this interview question too difficult??
807603Feb 12 2008 — edited Feb 13 2008Hello,
I was asked to write a java code(given below) in around 20 mins in an interview.
I was not able to solve it, do you think this is too difficult or I need more practice??
Q Implement the class of arraylist given below without importing java.uti*
(I had to write code within the methods as if I am inventing an arraylist
You can see the code that I am supposed to write here http://209.85.165.104/search?q=cache:YJ804VTiDXEJ:www.docjar.com/html/api/java/util/ArrayList.java.html+source+code+for+arraylist&hl=en&ct=clnk&cd=1&gl=us&ie=UTF-8&client=firefox-a
but without importing java.util*
public class MyArrayList {
public Object get(int index){
return data[index];
}
public Object remove(int index){
}
public int indexOf(Object e){
}
public int size(){
return size;
}
}