public static String checkDomain(String url) { //напишите тут ваш код if (url.endsWith("com")) { return "com"; //напишите тут ваш код } else if (url.endsWith(".net")) { return "net"; } else if (url.endsWith(".org")){ return "org"; } else if (url.endsWith(".ru")) { return "ru"; } else { return "неизвестный"; } }