String - ispalindrome challenge

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
System.out.println(isPalindrome(str));
}
public static boolean isPalindrome(String str)
{
for(int i = str.length()-1;i>=0;iā€“)
{
StringBuilder sb = new StringBuilder();
sb.append(i);
}
String str1 = sb.toString();
if(str == str1)
{
return true;
}
else
{
return false;
}

}

}
gives me error

problem solved just now

@Naman_Gupta mark it resolved then buddy! Good work!