Actually i m doing constructor implementation.But i am new to java, can any tell what going on from line 11 to 14.I am having problem in understanding the bold in line 12 and line 13.Plz help.....
1. public class Animal {
2. String name;
3. Animal(String name) {
4. this.name = name;
5. }
6.
7. Animal() {
8. this(makeRandomName());
9. }
10.
11. static String makeRandomName() {
12. int x = (int) (Math.random() * 5);
13. String name = new String[] {"Fluffy", "Fido",
"Rover", "Spike",
"Gigi"}[x];
14. return name;
15. }
16.
17. public static void main (String [] args) {
18. Animal a = new Animal();
19. System.out.println(a.name);
20. Animal b = new Animal("Zeus");
21. System.out.println(b.name);
22. }
23. }