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 | 29 | 30 | 31 |
Tags
- jdbc driver
- join
- VARIABLE
- SPLIT
- sql랭킹
- array
- JavaScript
- FileSystemObject
- inner join
- sql순위
- VarType
- ERD
- 정규식
- 인젝션
- 자바기초
- WML
- javascript 한글입력체크
- 한글입력체크
- update
- 이미지세로길이
- injection
- instr
- tempDB
- xmldom
- wap
- sql업데이트
- asp함수
- XML
- MSSQL보안
- 이미지가로길이
Archives
- Today
- Total
3초기억력
제어자)static 본문
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
// 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