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 are thread priorities and importance of thread priorities in java?

710


Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.

615


how its run?

687


What is java Applet?

729


Difference between comparator and comparable in java?

704






What are recursive functions?

681


What is basic syntax?

643


What is java and their uses?

636


What restrictions are placed on method overriding?

732


What is a null class?

662


What is gc()?

656


What is the main use of generics in java?

604


Why set is used in java?

657


How does a cookie work in Servlets?

460


What is java and its types?

644