forked from IF-LK-2020/array
or
This commit is contained in:
10
Arrays.java
10
Arrays.java
@@ -192,7 +192,15 @@ public class Arrays {
|
||||
* Für ein leeres Array wird <code>false<code> zurück gegeben.
|
||||
*/
|
||||
public boolean or( boolean[] pArray ) {
|
||||
return true;
|
||||
if (pArray == null || pArray.length == 0) {
|
||||
return false;
|
||||
}
|
||||
for (boolean b : pArray) {
|
||||
if (b) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user