public class Edad { public static void main (String []args) throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader (System.in)); int num; System.out.println("Escribe tu edad: "); num= Integer.valueOf(in.readLine().trim()).intValue(); if (num>=18) { System.out.println("Eres mayor de edad"); } else { System.out.println("No eres mayor de edad"); } } }