subject

Can someone tell me what's wrong here? I'm starting at the index of 0, but getting this error.
import java. util.*;
import java. io.*;

public class Person{

private String person;
private String mother;
private String father;
private String [] array;

public Person (String person, String mother, String father, String [] array){

this. person = person;
this. mother = mother;
this. father = father;
this. array = array;

if (mother. equals("n/a")){

mother = "not found";

}

if (father. equals("n/a")){

father = "not found";

}

}

public String getPerson (){

return this. person;

}

public String getMother (){

return this. mother;

}

public String getFather (){

return this. father;

}

public String [] getKids (){

String [] kids = {"","","","",""};

for (int i = 0; i < array. length - 1; i++){

String name = array[i];
kids[i] = name;

}

return array;

}

}

My error:

Exception in thread "main" java. lang.: Index 3 out of bounds for length 3
at Person. getKids(Person. java:62)
at FamilyTree. getKidsLine(FamilyTree. java:129)
at FamilyTree. printFamilyTree(FamilyTree. java:73)
at FamilyTreeClient. main(FamilyTreeClient. java:10)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
Ineed on my history if anyone can check out the last few questions i posted and i will be posting !
Answers: 2
question
Computers and Technology, 22.06.2019 13:30
Asoftware company hired ray, a college graduate to work in their development team. ray is assigned to work in the coding phase of a project. what happens during the coding phase of a software development project? a. the customer receives a working model of the software. b. developers convert the program design into code. c. developers gather requirements directly from the stakeholders. d. testing teams check the product for quality.
Answers: 1
question
Computers and Technology, 22.06.2019 16:30
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
You know the right answer?
Can someone tell me what's wrong here? I'm starting at the index of 0, but getting this error.
Questions
question
Mathematics, 03.12.2020 02:40
question
Mathematics, 03.12.2020 02:40
Questions on the website: 13722360