• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2414
  • Last Modified:

Convert int to string in JSP

I'm using if statement in JSP but I get error because the if statement include 2 condition the 1st one is string and the second one is integer with using &&
0
bworld
Asked:
bworld
1 Solution
 
KuldeepchaturvediCommented:
why you are comparing an integer to String? If your string is having a number value then you can convert the String to int and compare to int..

coverting a string to intger.

int num = new Integer("yourstring").intValue();
0
 
mrcoffee365Commented:
If you want to convert an int to a String, the easiest way is:

int myInt = 4;
String intStr = "" + myInt;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now