friend's

 avatar
Quelicori
java
2 years ago
619 B
2
Indexable
Never
public class lesson20 {
    public static void main(String[] args) {
        Human human1 = new Human("bob", 23);
        System.out.println(human1);
    }
}

class Human {
    private String name;
    private int age;

    public Human(String name, int age){
        System.out.println("hello 3");
        this.name = name;
        this.age = age;

    }

    public void SetName (String name){this.name = name;}
    public void setAge (int age){this.age = age;}

    @Override
    public String toString() {
        return "HI my name is " + name +" and I am " + age + " years old";
    }
}