fork download
  1. public class Manojfirstapp {
  2. public static void main (String[] args)
  3. {
  4. Sachin s = new Sachin();
  5. s.sachinscore();
  6. }
  7. public class Sachin {
  8. public void sachinscore()
  9. {
  10. float a1 = 102.00;
  11. float a2 = 89.00;
  12. system.out.println( a1 + " runs in" + a2 + " balls" );
  13. }
  14. }
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class Manojfirstapp is public, should be declared in a file named Manojfirstapp.java
public class Manojfirstapp {
       ^
Main.java:4: error: non-static variable this cannot be referenced from a static context
Sachin s = new Sachin();
           ^
Main.java:10: error: possible loss of precision
float a1 = 102.00;
           ^
  required: float
  found:    double
Main.java:11: error: possible loss of precision
float a2 = 89.00;
           ^
  required: float
  found:    double
Main.java:12: error: package system does not exist
system.out.println( a1 + " runs in" + a2 + " balls" );
      ^
5 errors
stdout
Standard output is empty