import java.util.Scanner; public class Main { public static void main(String args[]) { String s1; Scanner sc=new Scanner(System.in); System.out.println("Enter String : "); s1=sc.nextLine(); StringBuilder sb1=new StringBuilder(s1); System.out.println(sb1.toString().endsWith("Welcome")); } }
Enter String : Welcome to Java Class
false