Convert String to Integer in Java

Problem

Given the following String containing a textual representation of an Integer:

String s = "1";

How to convert this String to an Integer?

Solution

Integer i = Integer.parseInt(s);