How to convert String into primitive datatype.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is comparable and comparator interface?

582


What is the use of conditional statement?

564


How do I convert a string to an int in java?

553


What is meant by stack and queue?

606


What is java instanceof operator?

564






How do you find the maximum number from an array without comparing and sorting?

641


What is assembly condition codes?

558


Can you pass by reference in java?

528


What is java argument list?

522


What are the different types of multitasking?

660


What are filterstreams?

615


What is difference between final and immutable?

561


What is hashset in java?

531


What is the difference between declaration and definition in java?

519


What is return null in java?

512