-6
 orderAttributeType.setName(hirTask.getEscalationLevel());

HI, here i am getting integer value to by using these(hirTask.getEscalationLevel).setname is expexcting sting value.Can any one tell me how to parse integer to string.

4
  • 2
    Integer.toString(int value) Commented Dec 29, 2014 at 9:21
  • 2
    search on Google first. Commented Dec 29, 2014 at 9:21
  • 2
    have you tried String.valueOf(myInteger)? Commented Dec 29, 2014 at 9:21
  • 2
    String.valueOf(intVariable); Commented Dec 29, 2014 at 9:21

2 Answers 2

3

You can use Integer.toString(int) like

Integer.toString(hirTask.getEscalationLevel())

or String.valueOf(int)

String.valueOf(hirTask.getEscalationLevel())

or even

"" + hirTask.getEscalationLevel()
Sign up to request clarification or add additional context in comments.

2 Comments

I don't think that "" + int is a good way to do that:)
@pbespechnyi That is why it's last on the list!
2

Try String.valueOf(int) or if integer in a wrapper class object integer.toString().

4 Comments

Integer not integer :)
@TheLostMind, Integer is a class, integer is an object;)
public static String toString(int i) :)
@TheLostMind, ahaha, yes, there is a static method:)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.