Question: In Java, I have code for a Triad class for this card game but I'm having trouble with my TestTriad class to see if the
In Java, I have code for a Triad class for this card game but I'm having trouble with my TestTriad class to see if the code works. Using code below create a TestTriad class. Thankyou.
public class Triad private Card[] cards; e public Triad(Card one, Card two, Card three) cards new Card[3]; cards[0] = one; cards[1]-two; cards [2]-three; e public boolean isSet() return cards[0].getShading().equals (cards [1].getShading)) && cards[0].getShading().equals (cards [2].getShading)) && cards[0].getColor().equals (cards [1].getColor()) && cards[0].getColor().equals (cards[2].getColor()) && cards[0].getShape().equals (cards [1].getShape()) && cards[0].getShape).equals (cards [2].getShape()); e 0verride public String toString() return "Triad [cards-" Arrays.tostring(cards) +"]";l
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
