package resta; import java.io.*; public class Resta { public static int restar(int r) throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader (System.in)); int num1; int num2; int resta; System.out.println("Escribe un numero: "); num1= Integer.valueOf(in.readLine().trim()).intValue(); System.out.println("Escribe otro numero para restar: "); num2= Integer.valueOf(in.readLine().trim()).intValue(); resta= num1-num2; return resta; } public static void main(String [] args) throws IOException { int res= Resta.restar(0); System.out.println(res); } }