pointer 1. pointer 와 사용 목적- 변수의 메모리 주소- 2가지 목적 1) 불필요한 변수 복사 피하기 (avoid copy) 2) 변수 값 공유하기 (share data) 2. 연산자- 2가지 연산자( &, * )- 변수가 int 라면, 왼쪽 오른쪽 = & variable -> address * 포인트 변수라는 것을 나타냄. * address -> variable #include int main() { int b = 10; int *a = &b; //b variable 에서 address를 꺼내서 point 변수 a 에 매핑시키기 printf("%i\n", *a); //10 *a = 11; //point 변수 a 에 다른 값(11)을 매핑시키기 printf("%i\n", *a); //11 } 더보기 parameter로 객체 정보를 받아서 객체 생성 Class 객체 선언 및 Class 객체로부터 실제 Class 객체 생성 1) class 자체 사용 Class 더보기 FileFilter 1. 목적 파일 목록을 가져올 때, 파일 유형에 제한 걸기 (java 에서는 file 와 directory를 모두 같은 file로 생각한다.) ex. 특정 directory 내에서 directory 가 아닌 file 만 가져오기 / 특정 directory 내에서 file 이 아닌 directory 만 가져오기 2. 사용 예 File dir = new File("F:/books"); File[] files = dir.listFiles( new FileFilter() { @Override public boolean accept(File pathname) { return pathname.isFile(); //file 만 가져오기 //return pathname.isDirectory(); //directory .. 더보기 이전 1 ··· 15 16 17 18 19 20 21 ··· 36 다음