class Exam1 { // class = 예약어 ; Exam = 클래스명(사용자정의);
int c; // 맴버 변수 (전역변수); c=변수명 ; 알아서 초기화 된다.
public int add (int a, int b){ // int 반환하고자하는 자료형,정수형 ; (없을 경우void)
// add = 사용자 정의함수
// a, b = 지역변수(add안에서만 사용가능)
c= a+b;
return c; // c = int 타입
} // 맴버함수(임의의) ; public접근지정자(or protected,private..)
// 외부 접근 가능
} // 별도로 저장해서 편집해서 저장할때 public를 사용한다. 단,Exam로 저장
// -> 다른 곳에서 가져다 쓸수있다.
// -> 지금은 주클래스 이름으로 저장했음으로 안된다.
class ExamTest3 {
public static void main(String args[]) {
// 주클래스 , args[] :string객체의 배열을 잡아주겠다는 선언
int sum; // 지역변수는 반드시 초기화 후 사용해야 한다 -> 메로리 할당 args[0]
int x,y; // 지역변수는 반드시 초기화 후 사용해야 한다 -> 메모리 할당 args[1]
x= Integer.parseInt(args[0]); // Integer=class명, .parseInt=static
y= Integer.parseInt(args[1]); // .로 접근하는 함수는 스태틱 함수!
Exam1 examobject=new Exam1(); // 객체정의 (생성:object->Exam->object)
// examObject이 stack(정적변수,지역변수)메모리에 할당된다.
// * heap(동적)메모리=정의되고 남거나 new연산자로 할당되는 메모리
// 함수포인터>함수테이블>(테이블간 공유)>객체
sum = examobject.add(x,y); // examobject안의Exam1의.add를 사용하겠다.
System.out.print("입력한 값의 합은" + sum + "입니다"); //string 객체로
// string형태 +10->1,0으로 만들어줌
// 10+30=40의 형태로
// System 클래스이름
// out 객체이름
}
}
//콘솔실행
// " java Example2 123 abcd " (123+ abcd를 기입하면)
// object class에서string 상속받는다
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 |
