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 use of using enum to declare a constant?

768


What is the finalize method do?

809


Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?

7709


What do you mean by chromounits in java8?

704


What is the final keyword denotes?

855


Tell us something about different types of casting?

697


What’s a deadlock?

818


How does callback work in java?

798


What are generic methods?

718


I don’t want my class to be inherited by any other class. What should I do?

780


What is the reason behind using constructors and destructors?

779


Write a program to find the whether a number is an Armstrong number or not?

764


How many types of design patterns are there?

768


Which package has light weight components in java programming?

874


Why is stringbuffer faster than string?

677