mardi 21 avril 2015

How to return all the elements in class ListBuffer?

I'm a bit confused on how to return all elements in a list. I'm trying to create a function that takes a string as input and returns a ListclassBuffer where all the elements are returned in the list. For example for string: "Author", my function would return the Listclass Buffer of all the authors in the list. First, all I would need to figure out what method to put the string into the listclassbuffer. I'm a little confused. Then I would use the .toList to convert this listclassBuffer. Afterwards, I'm thinking I need to design a four loop for this function where for each element in the list, I could use the .appends function to return all the elements about this? I'm just really confused about how set things up and how the code could look like.

Aucun commentaire:

Enregistrer un commentaire