public class propEx {
public static void main(String[] args) {
Properties prop = new Properties();
try {
InputStream in = new FileInputStream("aaa.properties");
prop.load(in);
System.out.println(prop.get("name"));
System.out.println(prop.get("email"));
System.out.println(prop.get("city"));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
}
}
}
public static void main(String[] args) {
Properties prop = new Properties();
try {
InputStream in = new FileInputStream("aaa.properties");
prop.load(in);
System.out.println(prop.get("name"));
System.out.println(prop.get("email"));
System.out.println(prop.get("city"));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
}
}
}
aaa.properties 파일 내용
name=Kim young Deok
email=ddddd@.naver.com
#city=seoul
city=Seoul
name=Kim young Deok
email=ddddd@.naver.com
#city=seoul
city=Seoul
'자바스터디강좌' 카테고리의 다른 글
| Properties 사용방법 (0) | 2010/01/22 |
|---|---|
| 간단한 NIO를 사용하여 파일 복사하기 (0) | 2010/01/22 |
| 서블릿으로 간단한 HTML코드 출력 (0) | 2010/01/20 |
| 넷빈 톰캣연동 (0) | 2010/01/19 |
| 이클립스 톰캣 연동 (0) | 2010/01/19 |
| JSP 기본 MVC패턴으로 만들어 보자.. (0) | 2009/05/20 |

