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. class Shape {
  8. public double area() {
  9. return 0;
  10. }
  11. }
  12. class Circle extends Shape {
  13. private double radius;
  14. public Circle(int radius) {
  15. this.radius = 1;
  16. }
  17. public Circle(double radius) {
  18. this.radius = radius;
  19. }
  20. public double area() {
  21. return Math.PI * radius * radius;
  22. }
  23. }
  24. class Rectangle extends Shape {
  25. private double length;
  26. private double width;
  27. public Rectangle(double length, double width) {
  28. this.length = length;
  29. this.width = width;
  30. }
  31. public double area() {
  32. return length * width;
  33. }
  34. }
  35. class Main {
  36. public static void main(String[] args) {
  37. int[] numArr = new int[5];
  38. int result = 0;
  39.  
  40. for (int i=0; i<5; i++)
  41. numArr [i] = i++;
  42.  
  43.  
  44. for (int i=0; i<5; i++)
  45. System.out.println(numArr [i]);
  46.  
  47. }
  48. }
Success #stdin #stdout 0.07s 52560KB
stdin
Standard input is empty
stdout
0
0
2
0
4