Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to convert String into primitive datatype.

Answer Posted / vikki

using parseInt() method for example

//String to primitive types
int iVal = Integer.parseInt(str);
long lVal = Long.parseLong(str);
float fVal = Float.parseFloat(str);
double dVal = Double.parseDouble(str);

Is This Answer Correct ?    32 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is purpose of applet programming?

1237


Can we override final method?

1068


How does hashset work in java?

1179


What are the drawbacks of singleton class?

1062


Can we override protected method in java?

1113


Why should we use singleton pattern instead of static class?

971


What are the object and class classes used for?

1087


What is the private method modifier?

1138


explain the difference between jdk and jvm?

1041


What is scope & storage allocation of global and extern variables? Explain with an example

1091


What is the main purpose of serialization in java?

1089


What are daemon Threads in java?

1261


What is difference between null and void?

1016


What is an image buffer?

1030


How do you sort in descending order in java using collections sort?

956