If I have the following code:
public Bicycle(int maxSpeed, String brand, int numOfGears, String name) {
And I wanted it to read a .txt file that had 1 line of information that was as follows: "3, Huffy, 6, Charles" and return an object that contains that info - how would be the best way to do that?
Would doing the following be enough to do that?
public Bicycle(int maxSpeed, String brand, int numOfGears, String name) {
Bicycle newBike = new Bicycle (read information from file here);
}
Please let me know if I can clarify the question any further.