I've searched online and cannot find an answer. Is it improper to assign an argument to more than one variable in a constructor or does there have to be a one-to-one relationship?
public A6HangmanLogic(String keyPhrase, int numberOfGuesses)
{
this.keyPhrase = keyPhrase;
this.numberOfGuesses = numberOfGuesses;
guessesLeft = numberOfGuesses;
}
The value of guessesLeft (a static int) is returned from an accessor method updated through a loop. I can certainly write a mutator method, but then I have to call it. I could also change this.numberOfGuesses to just guesses and not have that third variable assignment at all.