Fundamentals18 / 25
Up next

Parse a number

class Main {
    public static void main(String[] args) {
        int n = Integer.parseInt("42");
        double f = Double.parseDouble("3.14");
        System.out.println((n + 1) + " " + (f * 2));
    }
}
What you're solving

parseInt and parseDouble convert text