forked from IF-LK-2020/array
and() finished
This commit is contained in:
@@ -178,6 +178,14 @@ public class Arrays {
|
||||
* Für ein leeres Array wird <code>false<code> zurück gegeben.
|
||||
*/
|
||||
public boolean and( boolean[] pArray ) {
|
||||
if( pArray.length == 0 ) {
|
||||
return false;
|
||||
}
|
||||
for(int i=0;i<pArray.length;i++){
|
||||
if(pArray[i]== false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user