Boolean array, JAVA Programming

Assignment Help:
If I have a boolean array that contains 30 elements (boolean[] fish), how do I go about isolating every 10 elements to use for something specific?

Say there are 30 types of fish stored within the boolean array and 0-9 are fish found specifically in the Indian Ocean, 10-19 are fish found specifically in the Atlantic, and 20-29 are fish specifically found in the Pacific Ocean. And for those 10 fish [0-9], [10-19], [20-29], each is a different color (red, orange, green, blue, white, black, silver, yellow, purple and gold), where the colors and locations of the fish are enum types Colors and Locations.

How do I go about appointing those characteristics to the fish?

Ex: elements [0-9] are fish from the Indian Ocean and [0] is red, [1] is orange, [2] is green, [3] is blue, [4] is white, [5] is black, [6] is silver, [7] is yellow, [8] is purple, and [9] is gold.

elements [10-19] are fish from the Atlantic Ocean and [10] is red, [11] is orange, [12] is green, [13] is blue, [14] is white, [15] is black, [16] is silver, [17] is yellow, [18] is purple, and [19] is gold.

elements [20-29] are fish from the Indian Ocean and [20] is red, [21] is orange, [22] is green, [23] is blue, [24] is white, [25] is black, [26] is silver, [27] is yellow, [28] is purple, and [29] is gold.


Will I need to appoint those characteristics in the constructor after initializing fish = new boolean[30]?

Related Discussions:- Boolean array

Describe the concept of constructor chaining, Question: A new software ...

Question: A new software engineer has joined Axistex Ltd. The systems analyst informs him that the organisation works with different operating system. The HR department works w

For in statement, It is a distinct type of loop, used to iterate through th...

It is a distinct type of loop, used to iterate through the properties of an object or the elements of an array. For instance assume the following statement that loops through th

Need to develop web server, Project Description: I wish to prepare a Web...

Project Description: I wish to prepare a Web server which provides subsequent Web Services. 1. User login 2. User input data store to server 3. User fetches results fro

Find representative skyline points in to 2 dimensional data, Find represent...

Find representative skyline points in to two dimensional data Project Description: Run skyline algorithm run representative skyline algorithm up to skyline algorithm (Affi

A one page website where a user can input the information, A one page websi...

A one page website where a user can input the information including Company Name, Title, Activity, R/S, I also need the user to select the start date, end date, and check poi

Develop program using interactive brokers api, Develop Program using Intera...

Develop Program using Interactive Brokers API Project Description: We require a Matlab function using the Interactive Brokers API for real time trading with three arguments:

How does java allocate heap and stack memory?, Each time an object is start...

Each time an object is started in Java it goes into the area of memory named as heap. The primitive variables like double and int are allocated in the stack, if they are local inst

Use of unicastremoteobject in rmi, What is the use of UnicastRemoteObject i...

What is the use of UnicastRemoteObject in RMI? Ans) The UnicastRemoteObject class gives support for point-to-point active object references using TCP streams. Objects that need

Sum of six digits, How do I write a java program that enters a six digit nu...

How do I write a java program that enters a six digit number and takes the sum of the six digits?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd