java.lang.String
String 클래스 String 클래스는 다양한 생성자를 갖고 있다. 파일 내용을 읽거나, 네트워크를 통해 받은 데이터는 보통 byte[ ] 배열이므로 이것을 문자열로 바꿔주는 생성자가 자주 사용된다. //배열 전체를 String 객체로 생성 String str = new String(byte[] bytes); String str = new String(byte[] bytes, String charsetName); //배열의 offset 인덱스 위치부터 length만큼 String 객체로 생성 String str = new String(byte[] bytes, int offset, int length); String str = new String(byte[] bytes, int offset, int le..
2020. 11. 16.
최근댓글