Java – string conversion

I have a method that accepts string parameters In some cases, I want to pass the int value to this method For calling this method, I want to convert int to string For I am doing the following

aMethod(""+100);

There is another option

aMethod(String.valueOf(100));

Both are correct I don't know which is suitable? Which performance is better?

In most cases, this occurs in GWT I want to set the size of panels and widgets in GWT

Who can make suggestions?

Solution

Because you mainly use it in GWT, I will use the "" method because it is the best looking, and it will eventually be converted to JavaScript. There is no such thing as StringBuilder

Please don't hurt my skeet fanboys;)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>