Newbie Java woes
Date: 09/29/05
(Computer Geeks) Keywords: java
Hi, (To anyone familiar with Java)
I've just started Java at Uni and we've been given this
exercise to complete. Having never had any real experience in Java,
this problem is really starting to annoy me. The script is under the
cut...
import java.util.Scanner;
public class FirstProgram {
pulbic static void main(String [] args)
{
System.out.println("Welcome to the number adding program.");
System.out.println("Enter two whole numbers, seperated by a space:");
Scanner input = new Scanner(System.in);
int n1 = input.nextInt();
int n2 = input.nextInt();
int sum = n1 + n2;
System.out.println("The sum of those two numbers is" + sum);
}
;
}
I'm using DrJava and whenever I try to compile it tells me:
1 error found:
File: /home/cserv1_a/ug/jhs5rsi/SE15/ex1/FirstProgram.java [line: 6]
Error: expected
Not sure where to start. Any help would be appreciated. Thanks!
Source: http://www.livejournal.com/community/computergeeks/784404.html