I'm making a small program that simulates some of a bank's basic functions. I created a class Branch
and used an ArrayList to hold Branch
objects that the user would like to add. If I would like to specifically display all of the Branch names (one of the fields in the class) of each object contained in ArrayList<Branch>
, would that be possible? Or is it better to create an array of strings that will hold each branch name? Currently, when I try to print out the ArrayList it outputs the pointer (I think) to the console.
I can put my code up upon request.