Questions tagged as 'arraylist'

3
answers

How to transform an Array of Objects into a Simple Array? Javascript

I would like to know how I can transform an Object Array into a Simple Array only with a certain value. I have this: const names = [ {id:0, name:"Jean"}, {id:2, name:"Ricardo"}, {id:4, name:"Letiiicia"}, {id:5, name:"Dai"}, {i...
asked by 03.03.2018 / 16:55
2
answers

How to put information in the attributes of an object using ArrayList?

I created a Cliente class with attributes name, age, address, cpf. And in the main class I was to make a ArrayList of type Cliente , in this way ArrayList Cliente<String> = new ArrayList<>(); in order to create a...
asked by 25.03.2018 / 04:11
2
answers

When can I use static in the class?

I know that the use of static methods should be avoided, so I have a question and I do not know if it is right to implement ArrayList as static , it is accessed by several classes and contains data from every program (just wa...
asked by 27.09.2017 / 23:31
3
answers

Recover / locate object in arraylist

I am doing a small CRUD with the theme saving for study purposes. I created 3 classes: Savings, Accounts and Screen (UI Swing). On the screen I register an account with the attributes name, agency, account number (the balance starts with valu...
asked by 13.03.2018 / 10:24
2
answers

Delete duplicates of values in ArrayList [duplicate]

I have the following ArrayList<Integer> : ArrayList<Integer> sequencia = new ArrayList<>(); sequencia.add(2); sequencia.add(11); sequencia.add(12); sequencia.add(13); sequencia.add(14); sequencia.add(14); System.out.p...
asked by 27.12.2017 / 17:55
4
answers

Remove object from an ArrayList

I have an arraylist of objects, and I need to remove an object from it as follows. I need this object to be removed if the 'box' attribute of it stores the same value that was typed in my TextBox . Why am I setting up a parking sys...
asked by 07.12.2016 / 15:34
1
answer

Error removing object from an ArrayList

When I try to remove a int from arrayList it is simply an error. Code: ArrayList<Integer> colors = new ArrayList<>(); colors.add(Color.rgb(119, 103, 141)); colors.add(Color.rgb(33, 10, 208)); colors.add(Color.rgb(2...
asked by 06.08.2016 / 20:57
2
answers

Return data from a subobject

Here's what I've implemented so far: public class Interface { private List<Usuario> usuarios = new ArrayList(); private List<Tarefa> tarefas = new ArrayList(); Menu menu = new Menu(); public void program()...
asked by 15.11.2018 / 15:45
1
answer

Find String in ArrayList

ArrayList<String> posicoes = new ArrayList<String>(); posicoes.add("Ricardo;01051509912;gmail"); posicoes.add("Renato;123456789123;hotmail"); posicoes.add("Rodrigo;09873923121;yahoo"); I have a ArrayList whose name is po...
asked by 30.08.2017 / 05:23
1
answer

I can not add new student to my arraylist

I'm reviewing previous java stuff and in the midst of revising arraylists I found it difficult to add a student to the list. Each student has the following fields: name, type of student, type of course, subject 1, 2 3 and ID number. I can...
asked by 16.06.2017 / 01:16