converting strings to numeric primitive data


Converting Strings to Numeric Primitive Data Types

To convert a string which is containing digits to a primitive data type, wrapper classes can help. parseXxx method can be used to convert a String to corresponding primitive data type.

String value = "532";

int d = Integer.parseInt(value);

String value = "3.14e6";

double d = Double.parseDouble(value);

 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: converting strings to numeric primitive data
Reference No:- TGS0356456

Expected delivery within 24 Hours