How to convert String into primitive datatype.
Answers were Sorted based on User's Feedback
Answer / akshya kumar
using the wrapper classes, by using the function in
following way:
int i_var = Integer.parseInt(string_var); //and as in
answer #2
Integer, Float, Long are wrapper classes predefined in JAVA
with methods parseInt(), parseFloat etc respectively.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / akshya kumar
we can also use valueOf method of wrapper classes like:
int i_var = Integer.valueOf(string_var);
float f_var = Float.valueOf(string_vatr);
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / niranjan sahoo
by using parsing methods of the respective primitive type like if we want to convert into int then use parseint() , if float then use parsefloat()...
| Is This Answer Correct ? | 3 Yes | 3 No |
What is singleton service?
define the terminology association.
Difference between String and StringBuffer.
If an object reference is set to null, will the garbage collector immediately free the memory held by that object?
we have a 100 classes at that time which class we have to write main method? pls help me
Difference between error and exception
Can I overload to string method
what is the purpose of class "Object" which is base class for all classes?
What is a constructor, constructor overloading in java?
Why does java not allow multiple public classes in a java file ?
Explain the protected field modifier?
what is the difference between future and callable interface in java?