-
반응형
1. Input stream에서 line을 읽어온다.
2. 특정 문자열로 split해서 그 결과를 String[] 타입 변수에 저장한다.
import java.io.BufferedReader; import java.io.InputStreamReader; public class Application { public static void main(String[] args) throws Exception { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); String input = bufferedReader.readLine(); String[] strArray = input.split(" "); } }
'Java' 카테고리의 다른 글
문자열 뒤집기 예제 (0) 2020.12.10 형변환 (type casting) (0) 2020.12.04 라이브러리를 사용한 배열 정렬 (0) 2020.11.30 Map의 정렬 (0) 2020.11.28 Collection Framework (0) 2020.11.24