This was given as a quiz to us by our instructor. She gave me perfect score for this, but when I actually run the program on my PC it says "cannot resolve symbol". What does it means? How could I fix it? Can anyone please help me? Thank you very much!
import java.io.*; public class BufferedReader { public static void main (String[]args) { BufferedReader dataIn = new BufferedReader (new InputStreamReader(System.in)); String num; try { num = dataIn.readLine(); int number1 = Integer.parseInt(num); num = dataIn.readLine(); int number2 = integer.parseInt(num); } catch (IOException e) { System.out.println("Error!"); } int sum = number1 + number2; System.out.println("The Sum is " +sum); } }
EDIT:
By the way, I'm using NetBeans IDE 5.0