String Arrays Worksheet
By Mickey Arnold
starstarstarstarstarstarstarstarstarstar
Last updated 10 months ago
14 Questions
1 point
1
Question 1
1.
System.out.println(ray[0]); //line 1
System.out.println(ray[0]); //line 1
1 point
1
Question 2
2.
System.out.println(ray[0].charAt(0)); //line 2
System.out.println(ray[0].charAt(0)); //line 2
1 point
1
Question 3
3.
System.out.println(ray[6]); //line 3
System.out.println(ray[6]); //line 3
1 point
1
Question 4
4.
System.out.println(ray[1]); //line 4
System.out.println(ray[1]); //line 4
1 point
1
Question 5
5.
System.out.println(ray.length); //line 5
System.out.println(ray.length); //line 5
1 point
1
Question 6
6.
ray = "two two three five five six eight eight".split(" ");
System.out.println(ray[0]); //line 6
ray = "two two three five five six eight eight".split(" ");
System.out.println(ray[0]); //line 6
1 point
1
Question 7
7.
ray = "two two three five five six eight eight".split(" ");
System.out.println(ray[3/2].charAt(0)); //line 7
ray = "two two three five five six eight eight".split(" ");
System.out.println(ray[3/2].charAt(0)); //line 7
1 point
1
Question 8
8.
ray = "two two three five five six eight eight".split(" ");
System.out.println(ray[7/2]); //line 8
ray = "two two three five five six eight eight".split(" ");
System.out.println(ray[7/2]); //line 8
1 point
1
Question 9
9.
ray = "two two three five five six eight eight".split(" ");
System.out.println(ray[1]); //line 9
ray = "two two three five five six eight eight".split(" ");
System.out.println(ray[1]); //line 9
1 point
1
Question 10
10.
ray = "two two three five five six eight eight".split(" ");
System.out.println(ray.length); //line 10
ray = "two two three five five six eight eight".split(" ");
System.out.println(ray.length); //line 10
1 point
1
Question 11
11.
ray = "def-527-158-926".split("\\-");
System.out.println(ray[0]); //line 11
ray = "def-527-158-926".split("\\-");
System.out.println(ray[0]); //line 11
1 point
1
Question 12
12.
ray = "def-527-158-926".split("\\-");
System.out.println(ray[3*1]); //line 12
ray = "def-527-158-926".split("\\-");
System.out.println(ray[3*1]); //line 12
1 point
1
Question 13
13.
ray = "def-527-158-926".split("\\-");
System.out.println(ray[2].replaceAll("[46]","#")); //line 13
ray = "def-527-158-926".split("\\-");
System.out.println(ray[2].replaceAll("[46]","#")); //line 13
1 point
1
Question 14
14.
ray = "def-527-158-926".split("\\-");
System.out.println(ray[1]); //line 14
ray = "def-527-158-926".split("\\-");
System.out.println(ray[1]); //line 14