Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class T3Array {
- public static boolean metodoRIc (int[]x){
- if(x!=null&&x.length>0)
- return metodoRIc(x,x.length-1);
- else return false;
- }
- private static boolean metodoRIc (int[]x, int i){
- if(i==0)
- return x[i]%2==0;
- else
- return x[i]%2==0 && metodoRIc(x, i=i-1);
- }
- public static boolean metodoRIcc(int[]x,int i){
- if(i==x.length-1)
- return x[i]%2==0;
- else
- return x[i]%2==0 && metodoRIc(x, i++);
- }
- public static void main(String args[]){
- int [] x= {2,2,2,2,2};
- System.out.println(metodoRIc(x));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement