Post a New Question

Java help please

posted by .

I am trying to run the following program and am getting this error:



import java.util.*;

public class Pre2


static Scanner console = new Scanner(;

public static void main(String[] args)throws IOException

Scanner inFile = new Scanner(new FileReader("Pre2Input.txt"));

PrintWriter outFile = new

PrintWriter(new FileWriter("Pre2Output.txt"));

int num1, num2;

num1 = inFile.nextInt();

num2 = inFile.nextInt();

outFile.println("Sum = " + (num1 + num2));




What am I doing wrong? Pls help. Thanks in advanced :)

Answer This Question

First Name:
School Subject:

Related Questions

More Related Questions

Post a New Question