Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- // write your code here
- Person person = new Person();
- System.out.println("Age is: " + person.age);
- person.adjustAge(person.age);
- System.out.println("Adjusted age is: " + person.age);
- }
- public static class Person{
- public int age = 20;
- public void adjustAge(int age){
- this.age = age + 20;
- System.out.println("Age in adjustAge() is: " +age);
- }
- }
Add Comment
Please, Sign In to add comment