package ex11_5;
import java.io.File; // File 불러오기
public class Ex11_5 { System.out.println(f.getName()); System.out.println(f.exists()); System.out.println(f.getPath()); System.out.println(f.length()); System.out.println(File.separator); boolean a = new File("D:\\temp\\ccc").mkdir(); boolean b = new File("D:\\temp","1.txt").delete(); |
// File 객체 생성 안에 값은 (파일 경로,파일명지정)
// 지정한 파일명 출력
// exists()는 boolean형이기 떄문에 파일 존재시 true 없을시 false
// 지정한 파일의 경로를 출력한다.
// 파일의 크기를 츨력한다. // 현재 파일의 구분자를 출력
// D:\\temp\\ccc 이쪽경로에 mkdir 폴더를 생성해준다
// D:\\temp","1.txt" 1.txt파일을 삭제 |
그림
'프로그래밍 > Java' 카테고리의 다른 글
Thread 구현하기 (0) | 2012.06.19 |
---|---|
Thread 스레드 (0) | 2012.06.19 |
다형성을 메소드 인자 (0) | 2012.06.18 |
인터페이스 ( interface ) (0) | 2012.06.18 |
super 실습하기 (0) | 2012.06.18 |