'When to use Integer.parseint

Why is Integer.parseint() used when we have type casting?

Maybe another way to ask this question would be:

When should Integer.parseint() be used over type casting?



Solution 1:[1]

// System.out.println(foos); int foo = Integer.parseInt("45");

    foo+= 3;
    System.out.println(foo);
    int zoo = Integer.parseInt("4576876");
    System.out.println(zoo);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sunil kumar