/*
//첫 example (앞에 내용 생략..? ㅋ 미쳐 못적음 ㅜㅜ)
public class Oop001 {
public static void main(String[] args) {
A kk;
kk= new A();
kk.sub(); //polymorphism
kk= new B();
kk.sub(); //polymorphism
}
}
**/
class A {
int aa = 1;
}
class B extends A {
int bb = 2;
}
class C extends B {
int cc = 3;
}
class Oop001 {
public static void main(String[] args) {
C objc = new C();
System.out.println("objcobject의 object속성variable aa의 값은 " + objc.aa);
System.out.println("objcobject의 object속성variable bb의 값은 " + objc.bb);
System.out.println("objcobject의 object속성variable cc의 값은 " + objc.cc);
B j = objc; //automatic type casting
System.out.println("objcobject의 object속성variable aa의 값은 " + j.aa);
System.out.println("objcobject의 object속성variable bb의 값은 " + j.bb);
//System.out.println("objcobject의 object속성variable cc의 값은 " + j.cc);
//memory format으로 잡혀있지만 범위를 벗어났다.
//memory format으로 잡혀있지만 범위를 벗어났다.
//System.out.println("objcobject의 object속성variable cc의 값은 " + (c)j.cc); //X
//System.out.println("objcobject의 object속성variable cc의 값은 " + ((c)j).cc);
B jj =new B();
System.out.println("objcobject의 object속성variable aa의 값은 " + jj.aa);
////C c1=(C)jj;
//C c1 = (C)jj; //explicit type casting BUT 여기 example로는 call?은 안됨!
//System.out.println("objcobject의 object속성variable aa의 값은 " + c1.aa);
//System.out.println("objcobject의 object속성variable bb의 값은 " + c1.bb);
//System.out.println("objcobject의 object속성variable cc의 값은 " + c1.cc); //error
}
}
//자기자신 =this 상위=super
//objcreference variable
// -> objectreference variable -> a class = "1" + default constructor (objectreference variable)에 추가 = "a()"
// -> b class = "2" + default constructor (objectreference variable)에 추가 = "b()"
// -> c class = "3" + default constructor (objectreference variable)에 추가 = "c()"
//object화 -> object의 address value을 objcreference variable에 저장!
- Open in Google Docs Viewer
- Open link in new tab
- Open link in new window
- Open link in new incognito window
- Download file
- Copy link address
- Edit PDF File on PDFescape.com
element
| Font | |
|---|---|
| font-family | |
| font-size | |
| font-style | |
| font-variant | |
| font-weight | |
| letter-spacing | |
| line-height | |
| text-decoration | |
| text-align | |
| text-indent | |
| text-transform | |
| white-space | |
| word-spacing | |
| color | |
| Background | |
| bg-attachment | |
| bg-color | |
| bg-image | |
| bg-position | |
| bg-repeat | |
| Box | |
| width | |
| height | |
| border-top | |
| border-right | |
| border-bottom | |
| border-left | |
| margin | |
| padding | |
| max-height | |
| min-height | |
| max-width | |
| min-width | |
| outline-color | |
| outline-style | |
| outline-width | |
| Positioning | |
| position | |
| top | |
| bottom | |
| right | |
| left | |
| float | |
| display | |
| clear | |
| z-index | |
| List | |
| list-style-image | |
| list-style-type | |
| list-style-position | |
| Table | |
| vertical-align | |
| border-collapse | |
| border-spacing | |
| caption-side | |
| empty-cells | |
| table-layout | |
| Effects | |
| text-shadow | |
| -webkit-box-shadow | |
| border-radius | |
| Other | |
| overflow | |
| cursor | |
| visibility |
