Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- MSSQL보안
- inner join
- jdbc driver
- 정규식
- join
- WML
- 이미지세로길이
- javascript 한글입력체크
- SPLIT
- asp함수
- ERD
- JavaScript
- update
- 인젝션
- injection
- XML
- 이미지가로길이
- sql순위
- FileSystemObject
- VARIABLE
- xmldom
- array
- 자바기초
- sql업데이트
- 한글입력체크
- VarType
- instr
- wap
- tempDB
- sql랭킹
Archives
- Today
- Total
3초기억력
제어자)static 본문
// Static 은 객체 생성 X
// 클래스명.static 변수, 메서드명
//static int i; //오류
class FF{
// static int a; //오류
static int a = 900;
}
public class StaticEx {
static int i;
int i2 = 1;
void func() {
int i3 = 2;
System.out.println("static > " + i);
System.out.println("local1 > "+ i2);
System.out.println("local2 > "+ i3);
}
public static void main(String[] args) {
System.out.println(FF.a); //class 의 static 변수는 클래스명.변수명 으로 접근가능
System.out.println("==============");
System.out.println(i);
// System.out.println(i2); //인스턴스 멤버에 직접적으로 접근 안됨, 사용 불가
// System.out.println(i3); //인스턴스 멤버에 직접적으로 접근 안됨, 사용 불가
System.out.println("==============");
StaticEx s1 = new StaticEx();
s1.func();
}
}
'자바_기초' 카테고리의 다른 글
접근제어자) private (0) | 2019.06.07 |
---|---|
접근제어자) public (0) | 2019.06.07 |
GUI(awt) - Gridlayout (0) | 2019.05.27 |
GUI(awt) - Boarderlayout (0) | 2019.05.27 |
GUI(awt) - flowlayout (0) | 2019.05.27 |
Comments