java字符串数组如何输出
lewis
2017-09-02
25次阅读
使用for循环遍历字符串数组,然后将每个字符串都输出出来。代码如下所示:
public class Main {
public static void main(String[] args) {
String[] strArray = {"Hello", "World", "Java"};
for (String str : strArray) {
System.out.println(str);
}
}
}
输出结果为:
Hello
World
Java
这样就可以将字符串数组中的每个字符串都输出出来。

发表评论:
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。