예)
class Box { // class Box 를 개별 저장하는 경우! : class앞에 public을 기입,
int width;
int height;
int depth;
}
+ 생성자가 없는 경우,
JVM이 디폴트 생성자를 생성한다.
super()를 기본으로 포함하는
width=0;
height=0;
depth=0;
을 만든다.
mybox1 = new Box(); //메모리 구조
heap상에 정의된 메모리 공간은 그 기억공간을 지칭하는 별도의 이름이 없고
단지 stack상의 참조 변수가 번지값을 갖고 있을 뿐이다.
[public/private] [static/final] 변수형(자료형) 변수명;
>맴버변수
1.객체변수 (static과 final이 붙지 않은 변수)
2.static : 클래스 변수
3.final변수 : 종단 변수, "읽기전용변수"
= 상속(클래스에서),재정의(매서드에서),을 막기위한 속성
>상속관계
Package default 상속class o 내부class x
public 상속class o 내부class o
private 상속class x 내부class x
protected 상속class 0 내부class x
외부
Package default class x 상속class x
public class o 상속class o
private class x 상속class x
protected class x 상속class o
객체 참조 변수
: 객체에 대한 주소가 복사되어 전달되므로 결국 같은 객체를 가르치게 된다
ex)
Box mybox1 = new Box();
Box mybox2 = mybox1;
값이 아니라 주소만 넘어가는 것이다.
클래스 변수(static 데이터 맴버)는 static을 붙여 선언한다
new연산자로 객체를 만들기 이전에 정의한다.
소멸 : 프로그렘이 종료될때
단 한개의 메모리를 유지 =“this.”을 기재할 필요X.
모든 객체들은 클래스 변수를 공유
객체변수와는 달리 클래스 변수는 클래스 이름을 통하여 접근
생성자(Constructor)
생성자의 이름은 클래스 이름과 같다 (대소문자 까지도 일치)
결과형을 기재할 수 없다. (void 조차도 않된다.) =retun 사용도 불가
생성자 오버로딩(Overloading)
this(값) ; 형태로 같은 클래스의 다른 생성자를 자동 호출의 개념으로
수행시켜 줄 수 있다. (생성자의 첫번째 라인으로 반드시 구성한다)
"가나다라" = 문자열 String 객체로 자동 저장 (인수전달방식= 콜바이 레퍼런스로 진행)
this 용도...(부족..보충 또는 수정 필요)
1.위치 명확히
2.전역지칭(지역과같은때)
3.같은 크래스안에 다른 생성자를 호출할 필요가 있을때
= (항목3개중 사용자가 1개or2개 or3개중 어느 하나만 입력했을 경우
프로그렘상 디폴드 값을 지정해주기위해)
- 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 |
