Skip to content

Commit a5f26f6

Browse files
committed
Array
1 parent 8622f3a commit a5f26f6

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

ch08/Array.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
public class Array
2+
{
3+
public static void main(String[] args)
4+
{
5+
String[] str = {"Much", "More", "Java"};
6+
7+
int[] num = new int[3];
8+
9+
num[0] = 100;
10+
num[1] = 200;
11+
12+
str[1] = " Better ";
13+
14+
System.out.println("String array length is " + str.length);
15+
System.out.println("Integer array length is " + num.length);
16+
System.out.println(num[0] + "," + num[1] + "," + num[2]);
17+
System.out.println(str[0] + str[1] + str[2]);
18+
}
19+
}

0 commit comments

Comments
 (0)