hi,
i'm writing a program called Card and its tester, CardTest. i find it very difficult to handle the input from the user in between these two programs.
CardTest reads in a card value in such a format: 4S (meaning 4 of spades)
in my Card class, there is a method called getDescription() that returns a String variable with the value of the card.
so, in my Card class, there are a number of important things, notably:
the constructor
and the methodpublic Card() { String value, suit; }
in CardTest,public String getDescription() { sdkfa;dsjf i can figure out most of the logic }
i can say
^^^^^^^^^^^^^^^^^^^String cardName = in.nextString(); //the variable to hold the user inputed card Card card = new Card(System.in); card.getDescription(cardName) <-------
is this the right way to send the user input into the method??? i'm very confused. if not, how can i send user input into the method getDescription?
by the way, this does have to be done in separate classes..