my programs- Card and CardTest
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:
and the method
String value, suit;
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);
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..
Re: my programs- Card and CardTest- i don't know how to handle the user input in-betw
You need to declare the method signature to take in parameters before passing them.
public Card(String cardName)
// constructor code
Re: my programs- Card and CardTest
okay, i got it. the last thing is a logic error with the program. i don't know what to put inside the constructor... does it just allow me to make an object in the CardTest class?