I was going to change the int to String.

Asked 2 years ago, Updated 2 years ago, 19 views

int i = 5;
String strI = "" + i;

I don't know much about Java, so I think I can do it like this, but what's wrong?

java

2022-09-21 17:19

1 Answers

I don't usually do that Use either Integer.toString(i) or String.valueOf(i).


2022-09-21 17:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.