일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 전자정부
- Login with OAuth Authentication
- 상속예제
- 가변인자
- 25가지 효율적인 sql작성법
- 추상클래스
- 다운캐스팅
- Random
- 야구게임
- 업캐스팅
- 전체
- while
- 페이징
- jquery
- 스프링
- 로또
- 다형성
- 자바 야구게임
- angular2
- 형변환
- 이클립스
- 전체텍스트
- Full text
- 상속
- IBatis procedure
- Validations
- full text indexing
- 단축키
- 자바
Archives
- Today
- Total
nalaolla
static 예제 2 본문
728x90
반응형
- package test.com;
- import test.com.aaa.Test02AAA;
- public class Test02Main {
- public static void main(String[] args) {
- System.out.println("static...start");
- System.out.println(Test02AAA.name);
- System.out.println(Test02AAA.age);
- System.out.println(Test02AAA.address2);
- System.out.println("================================");
- Test02AAA.name = "daniel";
- Test02AAA.age = 41;
- Test02AAA.address2 = "구리시 수택동";
- System.out.println("aaa.name : " + Test02AAA.name);
- System.out.println("aaa.name : " + Test02AAA.age);
- System.out.println("aaa.name : " + Test02AAA.ADDRESS);
- System.out.println("================================");
- Test02BBB bbb = new Test02BBB();
- System.out.println("bbb.name : " + bbb.name);
- Test02AAA.aaa();
- Test02AAA.Test.abc();
- Test02AAA aaa = new Test02AAA();
- System.out.println(aaa.title);
- System.out.println("test02 static...end");
- } //end main
- } // end class
- package test.com.aaa;
- public class Test02AAA {
- public static String name;
- public static int age;
- public static String address2;
- public static final String ADDRESS = "SEOUL";
- public String title;
- static {
- address2 = "강남";
- System.out.println("address2 : " + address2);
- }
- {
- title = "제목";
- //System.out.println("title : " + title);
- }
- public static void aaa(){
- System.out.println("aaa()..");
- }
- public static class Test{
- public static void abc() {
- System.out.println("ttt");
- }
- }
- }
- package test.com;
- import test.com.aaa.Test02AAA;
- public class Test02BBB {
- String name;
- public Test02BBB() {
- name = "KIM";
- Test02AAA.name = "LEE";
- name = Test02AAA.name;
- }
- }
728x90
반응형
'JAVA > 11. Static' 카테고리의 다른 글
static 정의 및 예제 1 (0) | 2016.06.29 |
---|