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, 22.06.2019 19:30
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 22.06.2019 19:50
Write a car class having two private member variables called tank and speed. write public methods called pumpgas and gofast. the method pumpgas gets an integer for gas that must be pumped. that value needs to be added to tank (no more than 20 gallons). it must return the amount of gas that is purchased ($4 per gallon). the method gofast should increase the speed by 5 each time it is called.write a constructor for the above class that initialized both variables to zero.write a tostring to display both the tank and speed when the car is printed.modify the car class to implement the interface comparable and an interface called carinter having the public methods in carinter.write the main program to create an array of size 5 of type car. create 5 car objects having each location of the array to refer to one of the cars. test the pumpgas, gofast, equals method on the array items. write an enhanced loop to print all the car values (using a tostring written last time).write a generic method to find the minimum of four items. pass int, double, char, string and car objects to test this method.
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Need asap assignment directions: think of an organization (business, religious institution, volunteer organization, sports team) with which you have been involved. imagine outfitting it with an it infrastructure. prepare a plan for what you would do to support outfitting it. draw a map of a network connecting all the individuals, give them pcs and printers, and lay out the design as best you can. the purpose is to begin working with these concepts, not to build a perfect network.
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
You have been supporting csm tech publishing's windows server 2016 server network for over a year. the office has two windows server 2016 servers running active directory and a number of other roles. management has informed you that a small sales office is opening in the same building three floors up. the sales manager wants to install a sales application on a server located in the sales office. this server will have limited physical security because there's no special room dedicated for it, which means it will be accessible to non-it personnel and visitors. you're considering installing windows server 2016 server core on the new server because accessing its console regularly probably won't be necessary, and this server will be managed from one of the other csm tech publishing servers. what are the benefits and drawbacks of using server core for this branch office? what are some things you should do to set up this server management environment?
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
Social Studies, 29.08.2019 08:50
question
English, 29.08.2019 08:50
Questions on the website: 13722363