(String).endsWith [1] public boolean matches(String regex)
この文字列が、指定された接尾辞で終るかどうかを判定します。
if (input.matches("ho[gbw]e")) { System.out.println("It matches!"); }