Ledger Nano X - The secure hardware wallet
SHARE
TWEET

person

a guest Apr 8th, 2020 133 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Person{
  2.     private int age;
  3.     private Strting name;
  4.     private String lastName;
  5.     private String nationality
  6.    
  7.     // THIS IS A COMMENT, it is just whatever I want
  8.    
  9.     public Person(String name, String newLastName, int newAge, String newNationality){
  10.         this.name = name;
  11.         this.lastName = newLastName;
  12.         this.age = newAge;
  13.         this.nationality = newNationality;
  14.         if( this.isAmerican() ){
  15.             // Happy
  16.         }
  17.     }
  18.    
  19.     public String getName(){
  20.         return this.name; // equivalent to "return name;"
  21.     }
  22.    
  23.     public String getLastName(){
  24.         return this.lastName; // equivalent to "return lastName;"
  25.     }
  26.    
  27.     public int getAge(){
  28.         return this.age; // equivalent to "return age;"P
  29.     }
  30.    
  31.     public int getNationality(){
  32.         return this.nationality; // equivalent to "return nationality;"
  33.     }
  34.    
  35.     private boolean isAmerican(){
  36.         return nationality.equals("american");
  37.     }
  38.  
  39.     public static void main(String[] args){e.g.
  40.         Person hoa = new Person("Hoa", "lee", 1000000, "Vietnam");          // INSTANTIATING ONE OBJECT
  41.         System.out.println("NAME IS: " + hoa.getName());
  42.         System.out.println("LAST NAME IS: " + hoa.getLastName());
  43.         System.out.println("AGE IS: " + hoa.getAge());
  44.     }
  45. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top