How to convert String into primitive datatype.

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of flag?

583


What is the purpose of the enableevents() method?

585


What is maximum size of arraylist in java?

497


How the metacharacters are different from the ordinary characters?

564


Why we use multi threading instead of multiprocessing?

576






What is the final class?

550


When should the method invokelater() be used?

584


Is string a data type in java?

592


How do I get 64 bit java?

529


Explain parallel processing in java8?

637


What is array command?

561


Name few java util classes introduced with java 8 ?

507


How do you start a new line in java?

523


Can we have more than one package statement in the source file?

642


Write a program to print fibonacci series

613