fork download
  1. public class Main {
  2. public static void main(String[] args) {
  3. System.out.println("Simulating Graphics Output:");
  4. draw();
  5. }
  6.  
  7. public static void draw() {
  8. System.out.println("Drawing a rectangle:");
  9. for (int i = 0; i < 5; i++) {
  10. if (i == 0 || i == 4)
  11. System.out.println("**********");
  12. else
  13. System.out.println("* *");
  14. }
  15.  
  16. System.out.println("\nDrawing an oval (simulated with text):");
  17. System.out.println(" **** ");
  18. System.out.println(" * * ");
  19. System.out.println("* *");
  20. System.out.println(" * * ");
  21. System.out.println(" **** ");
  22. }
  23. }
  24.  
Success #stdin #stdout 0.08s 54600KB
stdin
Standard input is empty
stdout
Simulating Graphics Output:
Drawing a rectangle:
**********
*        *
*        *
*        *
**********

Drawing an oval (simulated with text):
   ****   
 *      * 
*        *
 *      * 
   ****