p.s.v.main(String args[]){
Basket<Fruit> b = new Basket<Fruit> ();
b.setElement(new Apple());
for(Object o: b) // compiler error.
//foreach not applicable for expression type
System.out.println(o);
}
could you please explain why the for loop is causing error.
Thanks