I want to know the difference in two approaches. There are some old codes on which I'm working now, where they are setting `primitive` values to a `String` value by concatenating with an empty String `""`.

```
obj.setSomeString("" + primitiveVariable);

```

But in this link [Size of empty Java String](https://stackoverflow.com/questions/12008706/size-of-empty-java-string) it says that **If you're creating a separate empty string for each instance, then obviously that will take more memory.**

So I thought of using `valueOf` method in `String` class. I checked the documentation [String.valueOf()](https://docs.oracle.com/javase/7/docs/api/java/lang/String.html) it says **If the argument is null, then a string equal to "null"; otherwise, the value of obj.toString() is returned.**

So which one is the better way

1. `obj.setSomeString("" + primitiveVariable);`
2. `obj.setSomeString(String.valueOf(primitiveVariable));`

The above described process of is done within a `List` iteration which is having a size of more than 600, and is expected to increase in future.