forked from IF-LK-2020/array
or() finished
This commit is contained in:
parent
106121a020
commit
1be004f517
10
Arrays.java
10
Arrays.java
|
@ -197,7 +197,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.length == 0 ) {
|
||||
return false;
|
||||
}
|
||||
for(int i=0;i<pArray.length;i++){
|
||||
if(pArray[i]== true){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue