I need to take in command prompt arguments, and use them to construct an object. I am taking a number of people and the boat size.
public RiverCrossingPuzzle(int numEach, int boatSize)
Creates a RiverCrossingPuzzle with numEach number of cannibals and numEach number of missionaries with a boat that can carry up to boatSize number of missionaries/cannibals. For example, the input can be "-n", "4", "-b", "3"
Should I do it like this:
this.numEach = Integer.parseInt(args[2]);
this.boatSize = Integer.parseInt(args[4]);
Or like this:
int numEach = Integer.parseInt(args[2]);
int boatSize = Integer.parseInt(args[4]);
this.boatSize = boatSize;
this.numEach = numEach;