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 the difference between synchronized and synchronized block?

495


Can we make the abstract methods static in java?

579


What is a generic data type?

564


What are the advantages of java?

506


What is ternary operator?

560






What are the core java topics?

558


What is :: operator in java 8?

552


What is widening and narrowing in java? Discuss with an example.

554


What about static nested classes in java?

582


What is meant by bytecode?

570


What is an i/o filter?

559


What is the difference between post and put?

533


Can we override constructor?

530


Where pragma is used?

592


How is garbage collection controlled?

725