fork(2) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.Scanner;
  7.  
  8. public class as{
  9.  
  10. public static float sum (float x,float y ){
  11. return x + y;
  12. }
  13.  
  14. public static void main (String[]args ){
  15. Scanner sc=new Scanner (System.in);
  16. float input =sc.nextFloat();
  17. float output =sc.nextFloat();
  18. char op = sc.next().charAt(0);
  19.  
  20. switch(op){
  21. case '+':
  22. System.out.println(sum(input,output));
  23. break;
  24. }
  25.  
  26. }
  27.  
  28.  
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:8: error: class as is public, should be declared in a file named as.java
public class as{
       ^
1 error
stdout
Standard output is empty