JAVA/에러

[ JAVA에러 ] The method replace(char, char) in the type String is not applicable for the arguments (String, int)

ucong 2020. 12. 16. 09:25
The method replace(char, char) in the type String is not applicable for the arguments (String, int) 

- int형을 String 형으로 변환시켜준다.

 

에러시 코드 body = body.replace("${article-detail__hit}", article.hit );
해결시 코드 body = body.replace("${article-detail__hit}", article.hit + "" );