How can we convert String to Integer?

Solution

String value can be converted to Integer using parseInt() method:-
                     Integer demo = Integer.parseInt(“10”);
Note :- If String provided as parameter is not an numeric value, it throws NumberFormat Exception.

Share this thread

Comments

Comments
comments powered by Disqus

Navigation

Social Media