Java-13강
2010년 1월 11일 월요일 13강
Object Class
finalize() – 소멸자
Wrapper class
primitive data type을 object로. 8개가 존재.
stack에 올라온 것을 heap으로
Math Class
round() 반올림
floor() 무조건 자름
ceil() 무조건 올림
String Class
- Strings are constant.
getByte()
length() – 문자갯수(o), 문자길이(x)
substring() – 문자열을 뽑아낼 때, javascript와 동일
StringBuffer class
Is final class
string 수정가능.
속도때문에 string 대신 stringbuffer를 사용.
string은 주소를 새로 할당해야하므로 느림.
StringBuilder (x) = v1.5이후 나옴
StringBuffer (o)
차이는 thread의 synchronization을 하느냐의 차이
동기화
System class
플랫폼과 밀접한관계를 맺고있다.
os의 정보를 읽어온다.
Java.util Package
1. Utility class (ch13)
2. Collection Framework (자바의 자료구조) (ch15)
2. Collection Framework (자바의 자료구조) (ch15)
Generic (ch14)
Utility
Enumeration<E> interface
Stack<E> class
Queue interface – LinkedList를 써야함
StringTokenizer class
/*
* String parsing 방법 3가지
*
* 1. String 클래스의 split()
* 2. java.util.StringTokenizer 객체이용하기
* 3. java.util.Scanner 객체이용하기
*
*/
부모는 Enumeration<E>
Random class
is used to generate a stream fo pseudorandom numbers
Date class
represents a specific instant in time, with millisecond precision.
Calendar class
시작일이 무슨 요일인가와
이 달의 마지막 날짜
gregorianCalendar 년월일 세팅할때
getActualMaxium
Locale class
a locale object represents a specific geographical, political, or cultural
Formatter class
an interpreter for printf-style
java.util.formatter




