I'm writing a program to simulate a small library. One class has a toString() method which overrides the one in the String class and prints out data in a certain form:
with the vertical lines being characters in the string to be returned. I know that the idnum uses the handy Integer.toString(int a) method but in order to print out the entire thing (idnum|title|author|copies|size_of_recall_list) do I need to convert it all into a string using the String class toString()? Or can just say
idnum + "|" + title + "|" +...?
2)another method in the same class called status() calls the aforementioned toString() (the overriding one) and then creates a new line for every patron who is in the recall list and prints their name. I'm not quite sure how to go about tackling that. I thought I could use /n (or
) or even
but it doesn't recognize it. And I'm not sure how I'm supposed to return a multi-line string...I've never seen that done before. Any help? Thanks. Owen