public class MainClass { public static void main(String[] arg) { String string1 = "abcde"; if(string1.endsWith("de")) { System.out.println("ends with de"); } }} ends with de