Тестовое задание на java
я его уже завалил =) теперь интересно почему.
Implement SimpleArrayList and write unit tests for the class.
Implement ReverseList.reverseList (List list) method and write unit tests for the class.
SimpleArrayList
package questions;
import java.util.Iterator;
/**
* SimpleList implements some methods of List interface
*
*
*
*/
public class SimpleArrayList
{
//array to store elements of the list
Object[] data;
/**
* Specified by: the same method of java.util.List
* @param index
* @return
*/
public Object get(int index){
//todo: implement
}
/**
* Specified by: the same method of java.util.List
* @param index
* @param obj
*/
public Object set(int index, Object obj){
//todo: implement
}
/**
* Specified by: the same method of java.util.List
* @param index
* @param element
*/
public void add(int index, Object element){
//todo: implement
}
/**
* Specified by: the same method of java.util.List
* @return
*/
public Iterator iterator(){
return new Iterator(){
//todo: implement
};
}
/**
* Specified by: the same method of java.util.List
* @return
*/
public int hashCode(){
//todo: implement
}
/**
* Specified by: the same method of java.util.List
* @return
*/
public boolean equals(Object obj)
{
//todo: impelment
}
/**
* Specified by: the same method of java.util.List
* @return
*/
public int indexOf(Object o){
////todo: impelment
}
}
ReverseListpackage questions;
import java.util.List;
/**
* Test task
*/
public class ReverseList
{
/**
* reverse the list given as the param
* !!! don't change the signature of the method
* @param list to be reversed
*/
public static void reverseList(List list)
{
//todo: impelment
}
}
25 коментарів
Додати коментар Підписатись на коментаріВідписатись від коментарів