Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a flowerBouquet class in Java Write a Java class called flowerBouquet. This class has two fields, flowerName and flowerColor. It has a method whichFlower0

image text in transcribed

Write a flowerBouquet class in Java Write a Java class called flowerBouquet. This class has two fields, flowerName and flowerColor. It has a method whichFlower0 which tells you the name and color of a flower. For example, if you create an object of this class with flowerName = "Lily" and flowerColor = "White", involving whichFlower will return a string that states "This flower is a white colored Lily". It has another method called sameFlower0 that tells you if a flower object is the same as another flower object. Two flower objects ate the same if both the flowerName and flowerColor for the objects is equal. In your main function, create a 'bouquet of flowers'. That is, create 2-3 objects of the flowerBouquet class. Call the whichFlower0 method on at least one flower. Call the sameFlower0 method for two cases, one where you have two similar flower objects and one where you have two distinct flower objects

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

Recommended Textbook for

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students also viewed these Databases questions