Question: ` ` ` public class Test { public static boolean calculate ( String s , int start, int end ) { if ( start >

```
public class Test {
public static boolean calculate(String s, int start, int end){
if (start >= end){
return true;
} else if (s.charAt(start)!= s.charAt(end)){
return false;
} else {
return calculate(s, start +1, end -1);
}
}
public static void main(String[] args){
boolean result1= calculate("level",0,4);
boolean result2= calculate("aaaaaa",0,4);
System.out.println(result1+"/"+ result2);
}
}
false/false
true/false
true/true
false/true
```
` ` ` public class Test { public static boolean

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!