Carey Brown wrote:You already have an order, you named it "computer", what you don't have is "extras". You if() statements bail out as soon as one is true so your requirement "any of the buttons selected" is not being met. You shouldn't return until the end of the method.
Junilu Lacar wrote:
I assume you meant "call from main()" -- my question would be, was this code provided to you like this? If so, then you'd need an instance of the class that this method is found in. Otherwise, you'd make it a static method as already discussed.
Sankalp Bhagat wrote:
And to call that method from main method, you have to create an object of the class where you have written that method as the method is non-static method and you are calling it from the static context as main method is static. And then call that method from that object reference and as your method is returning Cards object you have to assign the result the Cards.
Junilu Lacar wrote:As far as testing your code is concerned, I don't see anything in the requirement statement that you posted that prevents you from following Campbell's suggestion.