Solved

How to convert String to Integer?

Posted on 2002-05-30
2
291 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
[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 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

705 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