0

I've created an object called tour which is supposed to display an arraylist. Currently, the output is being displayed like this

enter image description here

This is a part of what I wrote in the file that it is supposed to read from:

Bukit Broga;Selangor;0.00;1980;Nature;20000

KKB Water Rafting;Selangor;80.0;1982;Outdoor Adventure;1000

Pisang River;Selangor;0.00;1972;Nature;4000

A-Famosa;Melaka;0.00;1511;Historical;20000

Stadhyus Church;Melaka;0.00;1782;Historical;20000

BabaNyonya Museum;Melaka;5.00;1970;Museum;20000

Taming Sari;Melaka;0.00;1965;Historical;25000

else if (menu == 4)//display all object
{
    find = false;
    System.out.println("This is theTourism List taken from a file listed in tourismList arraylist");


    for (int i = 0; i < tourismList.size(); i++) {
        tour = tourismList.get(i);//retrieve object from list

        System.out.println(tour);//print object using toString

    }
}
blurfus
  • 13,485
  • 8
  • 55
  • 61
ThePete
  • 33
  • 3
  • 2
    Trying using `.printf(...)` instead of `println(..)` and set the spacing for the output as desired - see this quick reference for options https://www.baeldung.com/java-printstream-printf – blurfus Feb 21 '20 at 01:15
  • Does https://stackoverflow.com/questions/2745206 help you? – Ynjxsjmh Feb 21 '20 at 02:47

0 Answers0