码迷,mamicode.com
首页 > 其他好文 > 详细

Integer.parseInt()函数的使用

时间:2020-02-16 14:44:00      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:integer   public   com   static   使用   字符串   字符   for   system   

//返回等价于该字符串内数字的等价整数值

package com.swust.ll;

public class Summation {
public static void main(String[] args) {
int sum=0;
int myStr=0;
String str[] = {"99","55","44","1","6","5"};
for(int i=0;i<str.length;i++) {
myStr=Integer.parseInt(str[i]);
sum+=myStr;
}
System.out.println(sum);
}
}

Integer.parseInt()函数的使用

标签:integer   public   com   static   使用   字符串   字符   for   system   

原文地址:https://www.cnblogs.com/walxt/p/12316726.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!