fork download
  1. /* package whatever; // don't place package name! */
  2. import java.io.*;// headers MUST be above the first class
  3.  
  4. // one class needs to have a main() method
  5. public class inputoutput{
  6.  
  7. public static void main(String[] args)throws IOException
  8. {
  9. String str;
  10. int a;
  11. System.out.println("enter a number");
  12. str=br.readLine();
  13. a=Integer.parseInt(str);
  14. System.out.println("result ="+a);
  15. }
  16. }
  17.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:5: error: class inputoutput is public, should be declared in a file named inputoutput.java
public class inputoutput{
       ^
1 error
stdout
Standard output is empty