<<< The Double class | Index | Comparing Strings >>> |
The Integer and Double toString static methods convert the corresponding primitive types to a String:
String counterString = Integer.toString(counter); String priceString = Double.toString(price);
The opposite conversion of String objects to primitive types is also done using static methods:
int quantity = Integer.parseInt(quantityString); double price = Double.parseDouble(priceString);
<<< The Double class | Index | Comparing Strings >>> |