Java – Convert int to String and vice versa

Overview This document describes different ways to convert different number data types to String and vice versa. Integer to String (Integer –> String) Primitive type int can be converted to String using either of following methods –  String str = String.valueOf(7); String str = Integer.toString(7); String str = “”+i;   Integer object can be directly converted