This content has been marked as final. Show 2 replies
Well I went ahead and made separate methods to return each value. I suppose that will work just as well, especially since now I don't have to declare a bunch of strings and int's to hold the data and pass to the method.
Well this would never work anyway
None of those can be changed within the method. Strings are immutable and 'int' is passed by value. Each of those parameters will have the same value after the method exits as they did before it was called.
public void getData(String n, int num, String c, String d)
Your book class should be using 'setters' to set the value of its instance variables.