forked from IF-LK-2020/array
and() finished
This commit is contained in:
parent
02553bdf9f
commit
106121a020
10
Arrays.java
10
Arrays.java
|
@ -178,7 +178,15 @@ public class Arrays {
|
|||
* Für ein leeres Array wird <code>false<code> zurück gegeben.
|
||||
*/
|
||||
public boolean and( boolean[] pArray ) {
|
||||
return true;
|
||||
if( pArray.length == 0 ) {
|
||||
return false;
|
||||
}
|
||||
for(int i=0;i<pArray.length;i++){
|
||||
if(pArray[i]== false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue