import java.util.Scanner; public class hello{ public static void main(String args[]){ Scanner input1=new Scanner(System.in); int a=input1.nextInt(); Scanner input2=new Scanner(System.in); int b=input2.nextInt(); int c; c=a+b; System.out.print(c); } } /* Main.java:2: error: class hello is public, should be declared in a file named hello.java public class hello{ ^ 1 error */ |
Double click to view unformatted code.