Advertisement
wingman007

JavaOOP_MyWorld

Nov 30th, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.62 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7. package myworld;
  8.  
  9. /**
  10.  *
  11.  * @author fmi
  12.  */
  13. public class MyWorld {
  14.  
  15.     /**
  16.      * @param args the command line arguments
  17.      */
  18.     public static void main(String[] args) {
  19.         // TODO code application logic here
  20.        
  21.         System.out.println("I am proud with my greates invention PI " + Person.PI);
  22.        
  23.         Person.nationality = "German";
  24.        
  25.         Person stoyan = new Person("Stoyan", 50);
  26.         // stoyan.name = "Stoyan";
  27.         // stoyan.age = 50;
  28.         // stoyan.setName("Stoyan");
  29.         // stoyan.setAge(50);
  30.         // System.out.println("I am a person! My name is " + stoyan.name + ". I am " + stoyan.age + " years old!");
  31.         // System.out.println("I am a person! My name is " + stoyan.getName() + ". I am " + stoyan.getAge() + " years old!");
  32.         stoyan.introduceYorSelf();
  33.        
  34.        
  35.         Person mariya = new Person("Mariya", 21);
  36.         // mariya.name = "Mariya";
  37.         // mariya.age = 21;
  38.         // mariya.setName("Mariya");
  39.         // mariya.setAge(21);
  40.         // System.out.println("I am a person! My name is " + mariya.getName() + ". I am " + mariya.getAge() + " years old!");
  41.         mariya.introduceYorSelf();
  42.        
  43.        
  44.         Person anonymous = new Person();
  45.         // System.out.println("I am a person! My name is " + anonymous.getName() + ". I am " + anonymous.getAge() + " years old!");
  46.         anonymous.introduceYorSelf();
  47.     }
  48.    
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement