Guest User

Untitled

a guest
Nov 17th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public static void main(String[] args) {
  2. // write your code here
  3. Person person = new Person();
  4. System.out.println("Age is: " + person.age);
  5. person.adjustAge(person.age);
  6. System.out.println("Adjusted age is: " + person.age);
  7.  
  8. }
  9. public static class Person{
  10. public int age = 20;
  11. public void adjustAge(int age){
  12. this.age = age + 20;
  13. System.out.println("Age in adjustAge() is: " +age);
  14.  
  15. }
  16. }
Add Comment
Please, Sign In to add comment