Question
Class Seed: Property of Seed: -seed boolean[2] Constructor of Seed: Define a constructor which takes as parameter an array of booleans of lenght 2 Methods
Class Seed: Property of Seed: -seed boolean[2] Constructor of Seed: Define a constructor which takes as parameter an array of booleans of lenght 2 Methods of Seed: Define a method getter and setter for the property. Override the method toString such that it prints: the string "hearts" if seed is [0,0] the string "diamonds" if seed is [0,1] the string "clubs" if seed is [1,0] the string "spades" if seed is [1,1] define a method +boolean getColor() {} which returns >false if the seed corresponds to an hearth or a diamond and >true if it corresponds to a club or a spade and it prints "red" or "black" accordingly with the card seed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started