Question
In Java language Program Create a game, which displays three circles that have the same color (any color besides yellow and black). Only one of
In Java language
Program Create a game, which displays three circles that have the same color (any color besides yellow and black). Only one of the circles turns into a yellow rock when it is clicked. The one that turns yellow is the one that holds the gold. Behind each circle is an object of type Rock. A Rock object has an attribute for color that is set to black. A subclass of Rock (called GoldRock) has color yellow/gold assigned to it.
Write a tester class that gives user chances to click on the circle that holds the gold. When a circle is clicked on, the color of it's associated Rock object will be displayed.
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