forked from JustinSDK/JavaSE6Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayElementDemo.java
More file actions
23 lines (21 loc) · 983 Bytes
/
ArrayElementDemo.java
File metadata and controls
23 lines (21 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package onlyfun.caterpillar;
public class ArrayElementDemo {
public static void main(String[] args) {
short[] sArr = new short[5];
int[] iArr = new int[5];
long[] lArr = new long[5];
float[] fArr = new float[5];
double[] dArr = new double[5];
byte[] bArr = new byte[5];
boolean[] zArr = new boolean[5];
String[] strArr = new String[5];
System.out.println("short 陣列類別:" + sArr.getClass());
System.out.println("int 陣列類別:" + iArr.getClass());
System.out.println("long 陣列類別:" + lArr.getClass());
System.out.println("float 陣列類別:" + fArr.getClass());
System.out.println("double 陣列類別:" + dArr.getClass());
System.out.println("byte 陣列類別:" + bArr.getClass());
System.out.println("boolean 陣列類別:" + zArr.getClass());
System.out.println("String 陣列類別:" + strArr.getClass());
}
}