Regarding problem in function signature

can u plz elaborate error in this?
import java.util.*;

public class Main {

public static void main(String args[]) {
    // Your Code Her
     String str="madam";
     String s;

boolean isPalindrome(String str)
{

    for(int i=str.length()-1;i>0;i--){
      s=""+str.charAt(i);
      
    }
    if(s.equals(str))
    return true;
    else 
    return false;

}

   isPalindrome(str);
}

}

Hii Ishant,
Write isPalindrome function outside the main function. And also write s = s + str.charAt(i) instead of s = “” + str.charAt(i) and initialize s with “” because s = “” + str.charAt(i) this command will always initialize s with a new character instead of adding character to previous string.