public class Solution {
public static void main(String[] args) {
String militaryCommissar = ", явитесь в военкомат";
Scanner oleh = new Scanner(System.in);
int a = oleh.nextInt();
String b = oleh.nextLine();
if ((a > 17) && (a < 29))
System.out.println( b +militaryCommissar);
else
{
}
}
}
Помогите, как понимаю допустил логическую ошибку, а не синтаксическую.
package com.javarush.task.pro.task03.task0302;
import java.util.Scanner;
/*
Призывная кампания
*/
public class Solution {
public static void main(String[] args) {
String militaryCommissar = ", явитесь в военкомат";
Scanner oleh = new Scanner(System.in);
int a = oleh.nextInt();
String b = oleh.nextLine();
if ((a > 17) && (a < 29))
System.out.println( b + militaryCommissar);
else
{
}
}
}