Skip to main content

Posts

Showing posts with the label conversion

How to convert int to a string?

How to convert int to a string? here is int value 200 is assigned to a variable called i. int intValue =200; how can can we get that 200 to string variable s.                 String stringValue; 1st Option: simply by adding a leading empty string to the integer.         stringValue = "" + intValue ; 2nd Option: use to string method of integer class.         stringValue = Integer.toString(intValue ) ; 3rd Option: use value of method in string class.         stringValue = String.valueOf(intValue );