String Arrays Worksheet

By Mickey Arnold
Last updated 10 months ago
14 Questions

System.out.println(ray[0]); //line 1

System.out.println(ray[0].charAt(0)); //line 2

System.out.println(ray[6]); //line 3

System.out.println(ray[1]); //line 4

System.out.println(ray.length); //line 5

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[3/2].charAt(0)); //line 7

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[1]); //line 9

ray = "two two three five five six eight eight".split(" ");

System.out.println(ray.length); //line 10

ray = "def-527-158-926".split("\\-");

System.out.println(ray[0]); //line 11

ray = "def-527-158-926".split("\\-");

System.out.println(ray[3*1]); //line 12

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[1]); //line 14