JAVAMARCO

JAVA, J2EE AND MORE

Main menu

Skip to content
  • Home

Tag Archives: cast

Object Cast 1: from String to int

Posted on January 11, 2009 by javamarco
Reply

In Java to cast from String to int you can use three lines of code:

String numberString = “27″;

Integer numberInteger = new Integer(numberString);

int nimberInt = numberInteger.intValue();

or just one line:

int nimberInt = new Integer(“27″).intValue();

Posted in Java, Snippets, String | Tagged cast, int, Integer, java, object, String | Leave a reply

Tag Cloud

Apache cast directive Eclipse eclipse fix include int Integer java java.util.Enumeration java.util.Iterator jdk jre Jsp Liferay Maven object String string capitalize theme Tomcat Velocity

Last News

  • Support your local app developer! ow.ly/b5y4z 2 days ago
  • Judges Selected for Duke's Choice Awards, get nominations in! ow.ly/b8v1d 2 days ago
  • RT @oracletechnet: More than 500 registered for "Modern Java Development" Dev Day in Red Shores next week; arrive early for a good seat!... 2 days ago
  • RT @jdeveloper: Placeholder Watermarks with ADF 11.1.2 dlvr.it/1ZWDc9 3 days ago
  • #JavaOne Kicks Off with *Sunday* Keynotes ow.ly/b6VyO 3 days ago
  • What's the demographics of your JUG membership? Diverse membership makes user groups better! ow.ly/b3A88 3 days ago
  • Video: Henrik Stahl discusses #javame #javaembedded #OPN ow.ly/b6HIw 4 days ago
  • Games, Robots, and Java, Oh my! #makerfaire ow.ly/b5w0g 4 days ago
  • Java 7 adoption at 23% w00t! ow.ly/b6pAG 4 days ago
  • RT @fabianenardon: Call for Papers for Devoxx'2012 is open: cfp.devoxx.com 4 days ago
  • RT @netbeans: Smarter, and now Faster! Check out #NetBeans 7.2 Beta: ow.ly/b65l7 #Java #JavaFX #C/C++ #Maven #PHP #Groovy 4 days ago
  • Saving sharks with Java #ecocean ow.ly/b3G70 4 days ago
  • Pix of Java at the Makers Faire #makerfaire ow.ly/b5uVY 4 days ago
  • RT @romainguy: Wow hackaday.com/2012/05/21/man… 4 days ago
  • Four Small Java Developments that Pack a Punch! #jHome #rasberrypi #robotics #semeconverenge ow.ly/aXjrN 5 days ago
  • at #GamifyOracle workshop, how to improve apps by including gaming principles 5 days ago
  • The #JavaEE 7 Platform: Developing for the Cloud #jeeconf ow.ly/b3Fx1 5 days ago
  • Best Practices for #JavaFX 2.0 Enterprise Applications, new OTN tech article by @JavaFXpert ow.ly/b3FZM 5 days ago
Follow @java

ubuntu_countdown

The next version of Ubuntu is coming soon
Blog at WordPress.com. | Theme: Duster by Automattic.
Follow

Get every new post delivered to your Inbox.

Powered by WordPress.com