import java.util.Scanner; public class Auto { private String model; private int speed; public void inputAutoData() { Scanner console = new Scanner(System.in); System.out.println("ÐведиÑе название авÑомобилÑ: "); model = console.nextLine(); while (model.isEmpty()) { System.out.println("Ðведено невеÑное знаÑение."); System.out.println("ÐведиÑе название авÑомобилÑ: "); model = console.nextLine(); } System.out.println("ÐведиÑе ÑкоÑоÑÑÑ Ð°Ð²ÑÐ¾Ð¼Ð¾Ð±Ð¸Ð»Ñ (Ð¾Ñ 0 до 250): "); speed = console.nextInt(); while (speed < 0 || speed > 250) { System.out.println("Ðведено невеÑное знаÑение."); System.out.println("ÐведиÑе ÑкоÑоÑÑÑ Ð°Ð²ÑÐ¾Ð¼Ð¾Ð±Ð¸Ð»Ñ (Ð¾Ñ 0 до 250): "); speed = console.nextInt(); } } public String getModel() { return model; } public int getSpeed() { return speed; } }