| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
刚上传了第1000题代码,可是提示这样的错误信息,求助import java.io.*;
import java.util.*;
public class Sum
{
public static void main(String[] args)
{
try{
BufferedReader in =
new BufferedReader(new InputStreamReader(System.in));
System.out.println("输入a:");
String s = in.readLine();
int a = Integer.parseInt(s);
System.out.println("输入b:");
String s1 = in.readLine();
int b = Integer.parseInt(s1);
int sum = a+b;
System.out.println("a+b=" +sum);
} catch(Exception e){}
}
}
提示错误:
Compile Error
Main.java:4: class Sum is public, should be declared in a file named Sum.java
public class Sum
^
1 error
求助求助
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator