Advertisement
kosmontin

2.2

Jan 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. class Human {
  2.     String name;
  3.     String gender;
  4.     int age;
  5.     double weight;
  6.     double height;
  7.  
  8.     void sayHello() {
  9.         System.out.println("Привет!");
  10.     }
  11. }
  12.  
  13. public class Main {
  14.  
  15.     public static void main(String[] args) {
  16.         Human[] man = new Human[10];
  17.         for (int i = 1; i < man.length; i++) {
  18.             man[i] = new Human();
  19.             man[i].sayHello();
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement