public class Test {
public static void main(String[] args) throws IOException {
byte[] bytes = new byte[100];
System.out.print("입력: ");
int readByteNo = System.in.read(bytes);
String str = new String(bytes, 0, readByteNo-1);
System.out.println(str);
}
}
public static void main(String[] args) throws IOException {
byte[] bytes = new byte[100];
System.out.print("입력: ");
int readByteNo = System.in.read(bytes);
String str = new String(bytes, 0, readByteNo-1);
System.out.println(str);
}
}
책에서는 문자열 입력 받으면 끝에 붙으니
readByteNo-2하라고 하던데 본이 컴에서 예제 실행하면
한 글자 짤림. 전과 달리 이제는 만 붙는거?
그런데 인텔리제이에서 코드 복사하면 검정 화면까지 복사되던데
그냥 글씨만 복사하는 방법 없음?
메모장에 옮겼다가 다시 복사하면 되기는 하는데 귀찮아서 그런데.
리눅스랑 윈도우랑 다름