์ƒˆ์†Œ์‹

๐Ÿ“ŒDevelop/โ˜•Java

[Basic] String to int , int to String ํ˜•๋ณ€ํ™˜

  • -

QUOTE THE DAY

“ ์—๋Ÿฌ ์—†๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“œ๋Š” ๋ฐ๋Š” ๋‘๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์žˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์„ธ๋ฒˆ์งธ ๊ฒƒ๋งŒ ์ž‘๋™ํ•œ๋‹ค. ”

- Alan J. Perlis (์•จ๋Ÿฐ J. ํŽ„๋ฆฌ์Šค)
 

 

Code

//String to Int
String str = "12345";
int num = Integer.parseInt(str);

//Int to String
int num2 = 123;
String str2 = Integer.toString(num2);

 

 

 

๋ฐ˜์‘ํ˜•

'๐Ÿ“ŒDevelop > โ˜•Java' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

๋™์‹œ์„ฑ ์ด์Šˆ  (0) 2024.01.24
[Java] Collections / ์ž๋ฐ” ์ปฌ๋ ‰์…˜  (0) 2023.02.16
[Basic] String to Date, Date to String ํ˜• ๋ณ€ํ™˜  (0) 2023.02.16
Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.