티스토리 뷰
Programming/Java
자바 기초 Basic of Java | Type of Variable by location, 위치에 따른 변수의 종류
프루브프로젝트 2021. 5. 12. 14:15
Type of Variable by location
선언 위치에 따른 변수의 종류
1. Class Variable (클래스 변수) = static + Instance Variable(IV)
2. Instance Variable (인스턴스 변수)
3. Local Variable (지역 변수)
static int cv; //Class Variable (static이 붙는다.)
int iv; //Instance Variable
int lv = 0; //Local Variable
//-------------------------------------
class Variables {
int iv; //Instance Variable
static int cv; //Class Variable
//----------- Class area
void method() {
int lv = 0; //Local Variable //----------- Method area
}
//----------- Class area
}
변수 선언문의 순서는 상관없다.
'Programming > Java' 카테고리의 다른 글
자바 기초 Basic of Java | What is 'Method'? 도대체 메서드란 무엇인가? (0) | 2021.05.13 |
---|---|
자바 기초 Basic of Java | Class Variable, Instance Variable 클래스변수와 인스턴스변수의 형태 (0) | 2021.05.13 |
자바 기초 Basic of Java | 클래스 작성 규칙, The rule of writing class in Java (0) | 2021.05.12 |
자바 기초 Basic of Java | What are Class and Object? 클래스와 객체 (0) | 2021.05.12 |
자바 기초 Basic of Java | 객체지향언어 Object-oriented language (0) | 2021.05.12 |
댓글
최근에 올라온 글
페이지 이동 안내
보던 글 목록 : 브라우저 뒤로 가기 메인 화면 : 좌측 상단 아이콘
보던 글 목록 : 브라우저 뒤로 가기 메인 화면 : 좌측 상단 아이콘
🍍 The GOAL: AI expert에 가까워지는 중
🍍 I am becoming AI expert who can develop cool things by coding.
🍍 I am becoming AI expert who can develop cool things by coding.