and() finished

This commit is contained in:
artem.didytschuk 2020-08-31 22:43:43 +02:00
parent 02553bdf9f
commit 106121a020
1 changed files with 9 additions and 1 deletions

View File

@ -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;
}
/**