• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2151
  • 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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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