Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify part1 assuming that now you have a bucket of lego blocks with various colors. Write a newclass Legos2 n the same package for this

image text in transcribed

image text in transcribed

Modify part1 assuming that now you have a bucket of lego blocks with various colors. Write a newclass Legos2 n the same package for this part Use an array of Color objects and initialize the array with the colors: Color red, Color. blue, Color. yellow, Color green, Color .pink, Color black, Color. magenta, Color orange and Color. cyan. For picking the next color for the block, use a java.util.Randomobject and generate a random integer using the nextlnt method. Use the length ofthe colors array as an argument (do not hard code the array length)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Accounting questions