본문 바로가기
java

시험

by 쩨이1 2024. 6. 21.

이진 파일을 읽거나 쓸 때는 FileInputStream, FileOutputStream

텍스트 파일을 읽거나 쓸 때는 FileReader, FileWriter

 

// 임의의 세 개의 나라 선택 (중복 선택 가능)

for (int i = 0; i < 3; i++) {

selected[i] = country[rand.nextInt(country.length)]; }

 

'java' 카테고리의 다른 글

16.1 FileInputStream  (0) 2024.06.20
15.3 FileWriter  (0) 2024.06.20
15.1 FileReader  (0) 2024.06.20
13.2.3 try-catch-finally  (0) 2024.06.20
12.5컴포넌트  (0) 2024.06.20