abstract class A {
//class A {
//void Sub();
/*
sub()함수는 이class에서 하는 역할은 없고
A class에서 상속되는 하위class에서 반드시 재정의 시켜서
사용할 것을 의무화하기위한 목적만을 갖고 있다.
*/
abstract void Sub();
//이럴때 추상적 매소드를 만들어지는데, 함수머릿부앞에 abstract
//추상적인 매소드는 구현해서는 안된다. "{}"조차 사용할 수 없다.
//추상적인 매소드 뒤에는 그냥 ";"로 끝난다.
//추상적인 매소드 뒤에는 반드시 추상적인 class가 되야하므로 ->abstract class A {로 해야한다
//이것을 추상적인 매소드라고 한다.
void Sub1(){ //일반맴버함수 : 모두다 추상적인 매소드가 올 필요는 없다.
System.out.println("A클래스");
}
}
class B extends A{
void Sub(){ //추상적인 class 재정의 -> 쓸게 없더라도 void Sub(){}정도는 정의해줘야한다.
//추상적인class로부터 상속되는 class앞에 추상적인 매소드를 재정의하지않으면 상속되는 클래스도
//자동적으로 추상적인 클래스가 되므로 클래스 예약어 앞에 abstract라는 예약어를 기재해야한다.
//참조변수는 정의가 가능하나 new연산자로 객체정의는 불가능
System.out.println("B재정의");
}
}
public class Abstract01 {
public static void main(String[] args) {
A a1;
//a1=new A(); // 추상적인 class는 참조변수 정의는 가능하나
// new연산자로 객체정의는 불가.
B b1;
b1 =new B();
}
}
- 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
- 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 |
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 |
