forked from IF-LK-2020/array
or() finished
This commit is contained in:
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.
|
* Für ein leeres Array wird <code>false<code> zurück gegeben.
|
||||||
*/
|
*/
|
||||||
public boolean or( boolean[] pArray ) {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user