or() finished

This commit is contained in:
artem.didytschuk
2020-08-31 22:46:30 +02:00
parent 106121a020
commit 1be004f517

View File

@@ -197,8 +197,16 @@ public class Arrays {
* Für ein leeres Array wird <code>false<code> zurück gegeben. * Für ein leeres Array wird <code>false<code> zurück gegeben.
*/ */
public boolean or( boolean[] pArray ) { public boolean or( boolean[] pArray ) {
if( pArray.length == 0 ) {
return false;
}
for(int i=0;i<pArray.length;i++){
if(pArray[i]== true){
return true; return true;
} }
}
return false;
}
/** /**
* Prüft, ob <b>genau ein</b> Element in einem Array von * Prüft, ob <b>genau ein</b> Element in einem Array von