for循环实现数组遍历、整形数组int[]、字符串数组String[]、char
package cn.wzt;
import java.util.stream.Stream;
public class ForIn {
public static void main(String[] args) {
int[] nums={10,20,30};
for (int i: Stream.of(1,2,3,4,5,6).toList()){
System.out.println(i);
}
for (int am:nums){
System.out.println(am);
}
for (String s:new String[]{"java","php","python"}){
System.out.println(s);
}
for (char c:"javascript".toCharArray()){
共有 0 条评论