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
Solved

How to convert String to Integer?

Posted on 2002-05-30
2
286 Views
Last Modified: 2010-03-31
Hello,

I want to convert a String to integer, how to do that

Thanks
0
Comment
Question by:yakelvin
2 Comments
 
LVL 2

Expert Comment

by:CSuvendra
ID: 7046253
Integer.parseInt(String) - returns int
Integer.valueOf(String) - returns Integer
0
 

Accepted Solution

by:
plrf earned 100 total points
ID: 7046261
if you want to convert String to Integer object   then


   String ns="250"; //any  string number
   Integer  n=new Integer(ns);

  and if you want  a int variable then

   String ns="250"; //any  string number
   Integer  n=new Integer(ns);
  int  nt=n.intValue();
 

 

 
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

828 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