There are nothing wrong in your code. If you want to display all the item in the ArrayList, you probably need to add a
toString()
method to your flights class and just let the
toString()
method of ArrayList do all the work.
flights
public String toString(){
return f_name+" "+s_name+" "+age;
JavaApplication10Arraylistandobjects
for (int i = 0; i < mi.size(); i++) {
System.out.println(mi.get(i).toString());
}