Most voted "arraylist" questions
The Arraylist class is an implementation of the List interface that uses an array to store elements.
Learn more…257 questions
Sort by count of
-
1
votes2
answers883
viewsRead lines from a TXT to Arraylist
I need to read a log saved in a TXT file that contains geographical coordinates in the following form: -54.123440,-21.123456 -54.123425,-21.123467 -54.123435,-21.123480 -54.123444,-21.123444…
-
1
votes1
answer67
viewsList<> getResults returns list with equal elements
Hello. I have the following table in mysql: create table resultado( data varchar(10), premio varchar(3), loteria varchar(5), milhar varchar(10), primary key(data, premio, loteria) ); The class that…
-
1
votes0
answers72
viewsProblems in a list - Ionic
Well, I’m developing an app with Ionic and firebase. Everything is happening as expected, however, when I try to bring the data for editing, the data is all in a column of the list, I did several…
-
1
votes2
answers66
viewsReturn data from a subobject
Below is what I implemented until then: public class Interface { private List<Usuario> usuarios = new ArrayList(); private List<Tarefa> tarefas = new ArrayList(); Menu menu = new Menu();…
-
1
votes0
answers25
viewsHow to view data from a TXT in my arrayList - Android Studio
Currently I do so: ArrayList<produtoItem> lista = new ArrayList<produtoItem>(); lista.add(new produtoItem(R.drawable.imagem, "AA", "AA", "AA", "AA")); adapter = new produtoAdapter(this,…
-
1
votes1
answer76
viewsAdd inside a new position array in javascript
var produtos = new Array(); produtos = [{"Id":2,"Nome":"X bacon","Valor":12,"Quantidade":1},{"Id":3,"Nome":"Lucas","Valor":9.97,"Quantidade":1},{"Id":4,"Nome":"teste","Valor":5,"Quantidade":1}] I am…
-
1
votes1
answer368
viewsUpdate Listview with notifyDataSetChanged()
Good afternoon guys, I’m not getting the use notifyDataSetChanged() to update my Listview. My application takes the data entered in the database and lists in the registration page, soon after, if…
-
1
votes1
answer72
viewsHow to leave default value in Static Arraylist in Java?
I am making a program with login screen and have a question: I want settar an "administrator" account in a ArrayList static and do not know how to proceed (or if this would be something plausible).…
-
1
votes1
answer64
viewsJavascript and conditional switch, problems when saving a dynamic value
Well I’m still learning a little bit more about javascript, and I’m using a little bit of jquery lately, this code is one of my most recent works, it’s a code editor. How it works? First, we have a…
-
1
votes2
answers83
viewsIs it possible to pass an array per parameter without instantiating it?
I wanted to pass one vetor (or a ArrayList) per parameter without instantiating it, but I’m quite lost on this, because usually I instate an object list and I add the data in this list, but as I…
-
1
votes0
answers38
viewsError while removing Listview item - Android
Well, I am working on a system that puts some items in a list, in sequence, using a Dialogfragment with the list of added items I would give the option to remove these items, the problem is there. I…
-
1
votes1
answer127
viewsError when adding side-by-side objects in an array
I need to add the methods get for a ArrayList, I tried with commas to separate, but it doesn’t work, I can only add if one is under the other, which is not good for me. I tried to create the…
-
1
votes2
answers98
viewsJson for List C#
I have this Json (Json 1) { "2": { "Data": "28/10/2019 12:50:26", "Id": 2, "Id_usuario": 0, "Latitude": -2, "Longitude": -52, "Portas": 8, "Status": "CHEIO" }, "5": { "Data": "28/10/2019 12:39:33",…
-
1
votes3
answers147
viewsDelete copied array item without deleting the item from its source - Vuejs
I would like to clone a list of numbers and be able to manipulate that cloned list without changing the source, but in the following situation when I delete the item from the cloned array it deletes…
-
1
votes1
answer241
viewsUsing Loop to traverse an array, stopping at the first item and waiting for a click to the next JAVA item
Good evening, folks, I’ve been trying to find a solution to my problem for three days without success. Let’s get to the problem. I have an external API that is on a server, I can already make the…
-
1
votes1
answer27
viewsChanging the value of an arraylist
I have a problem in CASE 4 of my code, I want to change the price of the movie by calling the set, But it doesn’t change. I think it’s a logic problem, I’m a beginner. public static void…
-
1
votes2
answers123
viewsCheck if Java List has duplicate object attributes
I need help creating a logic that checks whether certain attributes of an object, stored in a List<Object>, there are more than two times. I’ve tried using the Set<E> to check whether it…
-
1
votes0
answers66
viewsActivity Lists in C
I received the following activity in the topic of Lists in physical contiguity: "Complete the attributes of the contact list structure in the file list_contacts.h. Create a contact list file. c and…
-
0
votes2
answers964
viewsHow to take a string arraylist value, for a File array
I have a job to do, to do it, I need to pass information from an array composed of strings (which are the paths) to an array of files for reading these paths, I tried to get the value directly from…
-
0
votes1
answer1665
viewsPrint Arraylist, Java Swing
I am starting my studies in Java applications with Swing, and I have doubts about how to print my Arraylist. How best to print or list an Arraylist within a window? In my case we have an agenda, we…
-
0
votes2
answers95
viewsHashmap type attribute appears as Object
I’m using the Spring framework and the repositories, and in one of the interfaces of one of these repositories I have, for example, a method like this: @Query("select extract(month from…
-
0
votes1
answer493
viewsStore value in an Arraylist
Hello, I have a question regarding storing the value I get from a table in an arraylist of arraylist. As I should do to be able to store? For example: Private…
-
0
votes1
answer45
viewsSending Arraylist and General value to another Activity
I am creating an Activity, for example A and in it I have to add data of Releases (This class I Serialized), as name, type, etc... and I add also the updated general value on the screen and I have…
-
0
votes2
answers87
viewsError when filtering a value
Hello guys I am trying to filter a value coming from an imput using strpos() function. This value must be a URL and must contain a small string defined by a list. However the filter is not working…
-
0
votes3
answers2196
viewsCheck that the values of an array are all the same PHP?
I would like to check that all values in my array are equal and I did so : $minha_lista = array('a','a','a'); if(!empty($minha_lista)) { if(count(array_unique($minha_lista))===1){ return true; }…
-
0
votes0
answers47
viewsMethod giving error when returning value
I’m making the following mistake: cannot find simbol. He gives in the method Return, I checked my code and could not locate anything wrong. Follow the code below: public ArrayList<String>…
-
0
votes1
answer584
views -
0
votes1
answer401
viewsHow to join two Arrays?
Hello, I have the following problem I have an Arraylist that returns several small arrays of two positions String[] temp = new String[2]; and has the saved arrayList adds several "temp"; ArrayList…
-
0
votes0
answers169
viewsHow to open a PDF file in listview items?
I created an Arraylist list and wanted to open pdf files in it, but I am storing the pdf files in res/raw folder and when calling in String ("res/raw") the file just doesn’t open, which I do?
-
0
votes0
answers231
viewsHow do I list an Arraylist within a Jlabel
Person would like to know how to print an Arraylist inside a Jlabel, I am using Joptionpane but it shows one element at a time would like to show all the elements in a single window. Follow the code…
-
0
votes1
answer1990
viewsWhat is the most efficient method to remove an item from Arraylist?
I would like to know which of the methods available by the class ArrayList is more efficient to delete an item from the list.
-
0
votes1
answer706
viewsHelp with "n" primes algorithm in an Arraylist
Please I need urgent help, how to fix my code? every time I call the right error method,I am beginner and am locked in an exercise that requires primes based on a number n(in this case this.n),for…
-
0
votes0
answers412
viewsHow to create an Arraylist in javascript or JSON and fill it
I am developing a shopping page, where there are dropdowns that displays the options of products that the customer can buy, need that when the user click on add the content of this line is added in…
-
0
votes1
answer476
viewsTraverse a vector to a given number of indexes and form a list of values
I have the following vector: a = [10, 10, 10, 10, 10, 20, 20, 20, 20, 20] I need every five indexes to form a list of these elements. You’d look like this: b = [(10, 10, 10, 10, 10), (20, 20, 20,…
-
0
votes2
answers554
viewsWhat are the applications of day-to-day arrays? (examples of their usability)
I did a search on the internet about the use of arrays and found many results aimed at creating games just... But aside from this example, where I use more arrays (matrices) in everyday life…
-
0
votes1
answer403
viewsCompare values of several arrays contained in a PHP array
<?php $productos = array( 'producto1' => array( 'preco'=> 25, 'quantidade' => 5 ), 'producto2' => array( 'preco'=> 20, 'quantidade' => 50 ), 'producto3' => array(…
-
0
votes2
answers189
viewsProblem to add content in Arraylist
I have an abstract animal class, which feline and canine inherit from it, and I have a client class that owns 2 arrays, one to add felines and one for canines. However, when adding the feline in the…
-
0
votes2
answers58
viewsAdd Elements from one class to an arraylist in another class
I have a class Ticket, that creates a ticket. and I have to do a class CustomerService with a ArrayList Ticket type, which I called tickets and places all tickets created in this Arraylist.…
-
0
votes1
answer54
viewsAndroid - Custom Arrayadapter problems with content
I’m trying to make a ListView with a ArrayAdapter customized. When I use the ArrayList original all functional well but when I update the ArrayList and use notifyDataSetChanged() to update the…
-
0
votes1
answer101
viewsHow to display data in java Arraylist
How I list the information stored in an Arraylist in java? Follow the code for analysis. public class Main { public static void main(String[] args) { Aluno aluno = new Aluno();…
-
0
votes2
answers273
viewscomparing a variable with a vector or list
Usually to perform a conditional using an array or a list and need to perform a for and perform the if line by line in this way. //sendo item uma string e listaItens um List<String> for(String…
-
0
votes0
answers25
viewsChanging vector-specific positions, determining random and equal values
I have the following vector: [**17, 17**, 1954, 909, **17, 17**, 411, 844, **17, 17**, 1954, 909, **17, 17**, 411, 844] As noted, the indices [0,1]; [4,5]; [8, 9] and [12, 13] are equal. I need to…
-
0
votes0
answers54
viewsHow do I match a value of an array with another value in another array in Java?
I know how to get the value of an array position and compare the array values. As code below. for (int i = 0; i < listadosWifi.size(); i++) { /* pega o SSID e o BSSID */ providerName =…
-
0
votes0
answers85
viewsHow to access a method of an Arraylist in another frame?
Classe Pessoa : public class Pessoa { private String nome; private int idade; public Pessoa(String nome, int idade) { this.nome = nome; this.idade = idade; } public String getNome() { return nome; }…
-
0
votes1
answer43
viewsRemove all elements from the list without the Clean() method, is there a way?
For example I wanted to remove the elements from the list in this way: public class List : MonoBehaviour { List<string> inventário = new List<string>(); void Start () { for(int i =…
-
0
votes2
answers155
viewsProblem with Android Arraylist
I’m trying to create a listview with images and I’m getting this error and the app does not run. Error stack E/AndroidRuntime: FATAL EXCEPTION: main Process: com.pedido.meu.telas_meu_pedido, PID:…
-
0
votes1
answer48
viewsSave object to a list not the reference
The problem is the following I try to save the object in a List and what happens is that it saves the reference not the object someone can help me to solve this problem?…
-
0
votes2
answers1961
viewsPractical example List and Arraylist
I’m creating a list of Estudantes, but I find myself in the following situation. In point 2 gives me error because it says I have to take the Student inside the List but when I do point 1 is already…
-
0
votes1
answer523
viewsHow do I write data from an Arraylist to a txt file (in addition to reading the file when starting the program)?
Full Project Github Repository /*a human resources company specialising in market relocations (job vacancies), calls for the creation of a system to computerize its actions. Thus, she wants to…
-
0
votes1
answer150
viewsCreate a multidimensional array in Java table format?
I’m a beginner in Java and have doubts how to create Multidimensional Array, I have the table below How do I create a Multidimensional Array from this table?…