string (1) 썸네일형 리스트형 [이것이 자바다] 문자열 클래스 (String, StringBuilder, StringBuffer) String 클래스 String 클래스는 문자열을 저장하고 조작할 때 사용한다. ex) 네트워크 통신으로 얻은 byte 배열을 원래 문자열로 변환하는 경우 //기본 문자셋으로 byte 배열을 디코딩해서 String 객체로 생성 String str = new String(byte[] bytes); //특정 문자셋으로 byte 배열을 디코딩해서 String 객체로 생성 String str = new String(byte[] bytes, String charsetName); import java.util.Arrays; public class BytesToStringExample { public static void main(String[] args) throws Exception { String data = .. 이전 1 다음