回归学生;这对我不起作用:(

时间:2016-12-08 23:06:09

标签: java

我必须循环max_allowed_packet=1024M query_cache_size=256M innodb_buffer_pool_size=3072M ,但我甚至不知道如何使用return

nameFirst

问题解决了 ,谢谢大家这是工作:))

public List<String> b(final List<Student> students) {
    String result = "";

    for(Student student : students){
       result +=student.nameFirst;
    }

    return students;
}

1 个答案:

答案 0 :(得分:3)

将结果作为List并返回:

public List<String> b(final List<Student> students) {
  List<String> result = new ArrayList<>(students.size());

  for(Student student : students)
    result.add(student.nameFirst);

  return result;
}