Question: Write a static method any() that takes a boolean array as its argument and returns true if any of the elements in the array is

Write a static method any() that takes a boolean array as its argument and returns true if any of the elements in the array is true, and false otherwise.
Write a static method all() that takes an array of boolean values as its argument and returns true if all of the elements in the array are true, and false otherwise.

Step by Step Solution

3.39 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sure you can achieve this by using a simple loop in both cases Heres how you can do it ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction To Programming Questions!