fork(1) download
  1. class Square {
  2. public int side;
  3. public int area;
  4. public Square(int side) {
  5. this.side = side;
  6. area = side * side;
  7. }
  8.  
  9. public static void main(String[] args) {
  10. Square square = new Square(5);
  11. System.out.println("Tamanho do lado: " + square.side + " / Area: " + square.area);
  12. }
  13. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
Tamanho do lado: 5 / Area: 25