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