Advertisement
Guest User

Untitled

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