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
What’s the difference between callable and runnable?
Where is stringbuffer stored?
What is the final access modifier in java?
What is meant by collection in java?
1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?
What are methods and how are they defined?
what is daemon thread and which method is used to create the daemon thread? : Java thread
What is getkey () in java?
Why java is object oriented?
What is the final class?
What is a dynamic array java?
What are selection structures?
Can we nested try statements in java?
Can we declare an array without size in java?
What is meant by local variable and instance variable?