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

Can we override singleton class?

965


Why are lists ordered in java?

999


What is proper subset?

954


This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }

977


What is collection class in java? List down its methods and interfaces.

936


What are autoboxing and unboxing? When does it occur?

928


Name some OOPS Concepts in Java?

1050


In a class implementing an interface, can we change the value of any variable defined in the interface?

1066


Can we serialize arraylist in java?

990


In the below example, what will be the output?

1012


What is append function?

978


What are the main features of java?

948


What does nextint () do in java?

961


What is difference between an object and a class?

1109


What is a constructor overloading in java?

1022