The conversion method is as follows:
a="12345"; int i;
(Video tutorial recommendation: java video)
Method one:
i=Integer.parseInt(a);
Method 2:
i=Integer.valueOf(a).intValue();
Recommended tutorial: java entry program
The above is the detailed content of How to cast string type to int type in java. For more information, please follow other related articles on the PHP Chinese website!