Memory Drive

멤버변수 +1
반응형

[CODE type="java"]
class C1
{
int a=100;
static String b = "파이팅 자바";
}

class C2 extends C1
{
String b;
String x = "쉬운자바";
}

class Inheritance
{
public static void main(String args[])
{
C2 o = new C2();

System.out.println(o.x);
System.out.println(o.b);
System.out.println(o.a);
System.out.println(C1.b);
}
}
[/HTML][/CODE]

반응형

'Computer_IT > JAVA' 카테고리의 다른 글

연산자 instanceof  (0) 2006.04.01
예약어 super  (0) 2006.04.01
오버로딩(Overloading), 오버라이딩(Overriding)  (0) 2006.04.01
-- ++ 연산자 테스트  (0) 2006.04.01
JAVA 기본 Data타입  (0) 2006.04.01