본문 바로가기
TIL

JAVA | String valueOf(n)

by 홍차23 2020. 1. 28.

2020.01.27(화)

 

The java string valueOf() method converts different types of values into string. By the help of string valueOf() method, you can convert int to string, long to string, boolean to string, character to string, float to string, double to string, object to string and char array to string.

https://www.javatpoint.com/java-string-valueof

 

: 스트링값으로 변환해주는 메소드. char array->string 도 가능하다.

public class StringValueOfExample{  
public static void main(String args[]){  
int value=12345;  
String s1=String.valueOf(value);  
System.out.println(s1+10);//concatenating string with 10  
}}

 

//결과

1234510

 

 

'TIL' 카테고리의 다른 글

Netlify html 배포하기 - package.json 추가  (0) 2020.03.05
TIP | vscode 맥에서 소스 코드 정렬 / prettier 사용하기  (0) 2020.02.19
TIL D-11 연동 에러 해결  (0) 2020.01.12
TIL D-13 이번생은 처음이라  (0) 2020.01.09
TIL D-14  (0) 2020.01.09

댓글