Solved

Convert int to string in JSP

Posted on 2009-04-05
2
2,036 Views
Last Modified: 2012-05-06
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
Comment
Question by:bworld
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 24071661
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
 
LVL 27

Accepted Solution

by:
mrcoffee365 earned 500 total points
ID: 24072429
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Justin
In light of the WannaCry ransomware attack that affected millions of Windows machines, you might wonder if your Mac needs protecting. Yes, it does and here is how to do it.
Make the most of your online learning experience.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question