[java] char array를 print하면 왜 잘 출력될까?

나호영·2023년 3월 2일

char arrays can be printed well by the println method in Java because they are treated as a special case and converted to a string automatically. Other types of arrays require additional processing to print their contents properly.

char 배열은 다른 배열들과 다르게 System.out.println 메소드가 특별 케이스로 취급하여 해당 요소들을 모두 결합해 String 객체로 만들기 때문이다.

profile
공부 내용 기록

0개의 댓글