The Artima Developer Community
Sponsored Link

Java Answers Forum
String to Integer

3 replies on 1 page. Most recent reply: Sep 19, 2002 9:36 AM by Don Hill

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Ching-Lun Shih

Posts: 1
Nickname: kingdom
Registered: Sep, 2002

String to Integer Posted: Sep 18, 2002 10:03 AM
Reply to this message Reply
Advertisement
Hi, Could anyone please tell me how to convert "String" to Integer?

Thank you


Don Hill

Posts: 70
Nickname: ssswdon
Registered: Jul, 2002

Re: String to Integer Posted: Sep 18, 2002 10:29 AM
Reply to this message Reply
http://devcenter2.silverstream.com/SilverHelp37/Docs/Help/java/jdk/api/java/lang/Integer.html


Integer someNumber = Integer.valueOf(String);

You really should read the API, its all there, look at the Integer Class

thomas

Posts: 42
Nickname: turbomanic
Registered: Jul, 2002

Re: String to Integer Posted: Sep 19, 2002 9:00 AM
Reply to this message Reply
also Integer.parseInt(String s) will also work

Don Hill

Posts: 70
Nickname: ssswdon
Registered: Jul, 2002

Re: String to Integer Posted: Sep 19, 2002 9:36 AM
Reply to this message Reply
Well I would say half way, parseInt returns a int which would then require a convert to a big int or Integer

Don

Flat View: This topic has 3 replies on 1 page
Topic: java mail Previous Topic   Next Topic Topic: Out of Memory error - Programming for 3D in Java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use