Java 4일차 SuperClass 테스트

public class SuperTest
{
String girlName = "Kim";
String boyName = "Nick";

public void girl()
{
System.out.println(girlName);
}

protected void boy1()
{
System.out.println(boyName);
}

private void boy2()
{
System.out.println(boyName);
}
}

class SubTest extends SuperTest
{
public void start()
{
System.out.println(girlName);
this.girl();

this.boy1();
// this.boy2();
}
}

댓글 없음: