일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- struts2
- Spring
- paint
- 전화걸기
- Android
- 국제화
- 메소드
- Java
- OGNL
- 배열
- 어노테이션
- 안드로이드
- 이클립스
- HTML
- AWT
- oracle
- 생성자
- 예외처리
- mybatis
- 에러페이지
- Graphic
- layout
- 기본
- Menu
- 클래스
- Eclips
- 오버로딩
- JavaScript
- 메서드
- JSP
- Today
- Total
목록정의하기 (2)
note
public class StaticCount { int c; //인스턴스 변수 static int count; // 클래스(static)변수 /*객체 생성과 무관 호출에 의해 메모리에 올라가서 여러 객체에서 공유할 수 있음*/ public StaticCount(){ c++; count++; } } call 1 call 3 메인 call 2 class StaticTest001{//정적 메서드 정의하기 private static int a=10; private int b=20; public static void SetA(int new_a){ a = new_a; } public static int getA(){ return a; } } public class StaticTest02 { public static..
class MyDate2{//생성자 정의하기 private int year; private int month; private int day; //없어도 됨 (자동으로됨) public MyDate2(){ System.out.println("[생성자] : 객체가 생성될 때 자동 호출됩니다."); year=2011; month=12; day=16; } public void print(){ System.out.println(year + "/" + month + "/" +day); } } public class ConstructorTest02 { public static void main(String[] args){ MyDate2 d = new MyDate2(); d.print(); } } [생성자] : 객체가 ..