fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. char pi = 960;
  13. char sq = 178;
  14. double radius = 3;
  15. double area = 3.14159 * radius * radius;
  16. double circumference = 3.14159 * radius * 2;
  17.  
  18. System.out.println("The area of the circle is "+area);
  19. System.out.println("The circumference of the circle is "+circumference);
  20. // The pi unicode doesn't seem to work on my JGRASP b
  21. System.out.println("I used area = "+pi+"r"+sq+" and circumference = 2"+pi+"r");
  22. }
  23. }
Success #stdin #stdout 0.11s 320576KB
stdin
Standard input is empty
stdout
The area of the circle is 28.274309999999996
The circumference of the circle is 18.849539999999998
I used area = πr²  and circumference = 2πr