숫자와 문자열 사이의 변환

Simpler·2023년 9월 9일
0
  • (Boolean)

  • Byte

  • (Character)

  • Short

  • Integer
    .toString()
    .parseInt()
    .valueOf()

  • Long

  • Float

  • Double
    .parseDouble()

int n = 42;
String str = Integer.toString(n);
String str = String.valueOf(n);

String str = "101010";
int n = Integer.parseInt(str);
Integer refInt = Integer.valueOf(str);
profile
공부하는 프로그래머

0개의 댓글