Parsing value from a String
public class ConvertDataType {
public static void main(String[] args) {
String num = "1.4324";
double realNum = Double.parseDouble(num);
System.out.println(++realNum);
}
}
2.4324
- A String in Java is a non–primitive data type, because it refers to an object.