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

How to convert String to Integer?

Hello,

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

Thanks
0
yakelvin
Asked:
yakelvin
1 Solution
 
CSuvendraCommented:
Integer.parseInt(String) - returns int
Integer.valueOf(String) - returns Integer
0
 
plrfCommented:
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
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: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

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