How to convert a Java String to Integer ?

How to easily Convert String to Integer in JAVA

There are two ways to convert String to Integer in Java,

How to convert a Java String to Integer?

Let’s say you have a string – strTest – that contains a numeric value.