Advertisement
Guest User

Main

a guest
Jul 21st, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. package com.profi.constructors;
  2.  
  3. public class Main {
  4.  
  5.  
  6.  
  7.     public static void main(String[] args) {
  8.           Person person1 = new Person();
  9.           Person person2 = new Person("Alex", 20);
  10.           Person person3 = new Person("John");
  11.           Person person4 = new Person("Sergey",27, "543534534");
  12.  
  13.         System.out.println(person2.getAge());
  14.  
  15.         person1.setAge(-55);
  16.  
  17.           person1.print();
  18.           person2.print();
  19.           person3.print();
  20.           person4.print();
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement