i wanna create my own list but in the main i wanna print added items such as paris london etc while using for each loop but loop doesnt run and the error is required: array or java.lang.Iterable what should i do ? ty
public static void main(String[] args) {
Scanner input= new Scanner(System.in);
MyList<String> vo=new MyList<String>();
vo.add("paris");
vo.add("london");
vo.add("usa");
for(String city:vo) {
System.out.println(vo);
}
public class MyList<T> {
public void add(T values){
}
public void update(T values) {
}
}