Questions tagged as 'arraylist'

1
answer

How can I move an element of an ArrayList to the last element?

I wonder if there is any method to perform the operation, without being manually concatenated. Example of what you intended: [1,2,3,4] - > [1,3,4,2]     
asked by 14.04.2017 / 11:31
1
answer

Error trying to use ArrayList methods (unrecognized symbol)

IsimplycannotuseanyArrayListclassmethod(italwaysgivescompilationerror)andIhavenoideawhy.AmImakingasyntaxerror?Ididnotgetanyanswersbysearchingtheinternet.Itookpicturestodemonstrateexactlytheproblem.It'sasifhedoesnotrecognizethe"." The commen...
asked by 20.01.2017 / 20:56
1
answer

Why can not I access the elements inside an ArrayList with a for?

I'm trying to fill a JTable with elements that are inside an ArrayList, which is inside another object: private void jButtonConfirmarProdutoActionPerformed(java.awt.event.ActionEvent evt) {...
asked by 01.12.2016 / 19:18
1
answer

I add items to the ArrayList but when I use it it is empty

I can not add items to my ArrayList Main class where the array is instantiated public class act_principal extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener{ private List<Medico> medicos...
asked by 01.09.2016 / 18:15
2
answers

Data does not persist in the txt file

Good morning, I have a question, I have this code, which is a contacts agenda and the data should be persisted in a txt file. What happens is that the program runs normally, but the data is not saved in that file, which I stored in a folder loca...
asked by 17.02.2016 / 12:00
1
answer

Transform object into array while maintaining index

Good evening Friends who can help me? I have this Array of objects, I needed to make this Object in list more while keeping the index as it is UsingMapitchangestheindex: I then needed to access each item to perform calculations, but the...
asked by 04.07.2018 / 20:40
1
answer

Method remove () does not remove object from ArrayList

I have a question to remove an object from a list in a job. I have an automotive class: public class Automovel { String marca; String modelo; String preco; Automovel(String marca, String modelo, String preco) { thi...
asked by 15.04.2018 / 15:47
1
answer

Load list from txt in C #

I have the following problem, I get the data of a txt that I need to return in the form of List<List<string>> , however I can only get txt from a string [] linha , so I was adding string per string in my list, this it wor...
asked by 30.11.2017 / 00:04
1
answer

Alphabetically Sort an ArrayList [duplicate]

I have an ArrayList called Test with the fields: public class Teste { private String dctitle; private String rdfabout; private String dbid; private String depto; private String sigla; private String ciclo; privat...
asked by 10.10.2017 / 21:22
2
answers

Write and print data in an ArrayList

I'm doing a college job and I need to store the name and age of 10 people in an array and then print the data of the person who is in position 7, but when I go to print, returns null. I do not know if you are not saving the data in the arrayList...
asked by 07.06.2017 / 17:30