java数组的创建和遍历方法
import java.util.Arrays; public class StringDemo { static void m1() { int[] a = {1,8,3,9,4,6}; Arrays.sort(a); for (int i : a) { System.out.println(i); } } static void m2() { String[] b = {"hello","world","!"}; for (String ss : b) { System.out.println(ss); } } public static void main(String[] args) { System.out.println("abc"); m1(); m2(); } }