# Convert Integer to String in Java with Three Methods

> Convert an integer to a string in Java using String.valueOf, Integer.toString, or string concatenation, with code examples for each approach

**URL:** https://sentry.io/answers/how-do-i-convert-an-integer-to-a-string-in-java/

---

## The Problem

You don't know how to convert an `Integer` to a `String` in Java.

## The Solution

There are several ways to convert an `Integer` to a `String` in Java. This solution covers three of the most common approaches: using the `String.valueOf()` method, using the `Integer.toString()` method, and concatenating an integer with an empty string.

### Using `String.valueOf()`

The `String.valueOf()` method is one of the simplest ways to convert an `Integer` to a `String`:

```java
class Main {
    public static void main(String[] args) {
        int number = 123;
        String numberString = String.valueOf(number);
        System.out.println("Converted String: " + numberString);
    }
}
```

In this example, `String.valueOf(number)` converts the `int` value, `number`, to a `String`.

### Using `Integer.toString()`

Alternatively, you can use the `Integer.toString()` method to convert an `Integer` to a `String`:

```java
class Main {
    public static void main(String[] args) {
        int number = 123;
        String numberString = Integer.toString(number);
        System.out.println("Converted String: " + numberString);
    }
}
```

This method also converts the `int` value, `number`, to a `String`.

### Concatenating With an Empty String

You can also convert an `Integer` to a `String` by concatenating it with an empty string (`""`):

```java
class Main {
    public static void main(String[] args) {
        int number = 123;
        String numberString = number + "";
        System.out.println("Converted String: " + numberString);
    }
}
```

This approach works, but it's less readable than the previous methods.

---

*Source: [sentry.io/answers/how-do-i-convert-an-integer-to-a-string-in-java/](https://sentry.io/answers/how-do-i-convert-an-integer-to-a-string-in-java/)*
