-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArrayDemo.java
37 lines (29 loc) · 933 Bytes
/
ArrayDemo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package hello;
public class ArrayDemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] a;
a= new int[10];
double[] b = new double[10];
char[] c =new char[100];
boolean[] d = new boolean[20];
String[] s= new String[5];
System.out.println(a);
System.out.println(b);
System.out.println(c);
System.out.println(d);
System.out.println(s);
System.out.println("**********************************");
System.out.println(a[0]);
System.out.println(b[0]);
System.out.println(c[0]);
System.out.println(d[0]);
System.out.println(s[0]);
System.out.println("**********************************");
System.out.println("a+length="+a.length);
System.out.println("b+length="+b.length);
System.out.println("c+length="+c.length);
System.out.println("d+length="+d.length);
System.out.println("s+length="+s.length);
}
}