java使用Arrays类输出数组内容
import java.util.*; public class ArrayTest { public static void main(String[] args) { int[] arr={1,3,5}; System.out.println(arr); System.out.println(arr.toString()); System.out.println(Arrays.toString(arr)); } }
Arrays类一定要记得加“s”
import java.util.*; public class ArrayTest { public static void main(String[] args) { int[] arr={1,3,5}; System.out.println(arr); System.out.println(arr.toString()); System.out.println(Arrays.toString(arr)); } }
Arrays类一定要记得加“s”