allocating for array and then using constructor
问题 Person.java public class Person { public String firstName, lastName; public Person(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } public String getFullName() { return(firstName + " " + lastName); } } PersonTest.java public class PersonTest { public static void main(String[] args) { Person[] people = new Person[20]; //this line . for(int i=0; i<people.length; i++) { people[i] = new Person(NameUtils.randomFirstName(), NameUtils.randomLastName()); /