package chapter20230829.InnerClass;
class MyOuter1 {
private String name;
private int age;
public MyOuter1(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public class Inner {
private String addr;
public Inner(String addr) {
this.addr = addr;
}
public String getCustomerInfo() {
return "이름 : " + name + ", 나이 : " + age + ", 주소 : " + addr;
}
}
}
public class test {
public static void main (String[] args) {
MyOuter1 myOuter = new MyOuter1("홍길동" , 20);
MyOuter1.Inner inner = myOuter.new Inner("세종시 세종구");
System.out.println("고객정보 >>> " + inner.getCustomerInfo() );
}
}