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 the difference between the paint() and repaint() methods?

1060


What does exclamation mean in java?

1089


What is arraylist e?

1075


What is a method header?

1013


Write a program to print fibonacci series up to count 10.

895


Write a program to print count of empty strings in java 8?

995


What restrictions are placed on method overriding?

1170


If a class is declared without any access modifiers, where may the class be accessed in java programming?

1208


Who found java?

977


Can we create object of static class?

1018


Explain how can you debug the Java code?

1062


How to sort numbers in java without array?

973


Explain the transient field modifier?

1034


What do you understand by weak reference?

1005


What is starvation?

1305