I have a boolean array in java:
boolean[] myArray = new boolean[10];
What's the most elegant way to check if all the values are true?
public static boolean areAllTrue(boolean[] array) { for(boolean b : array) if(!b) return false; return true; }
1.4m articles
1.4m replys
5 comments
57.0k users