Skip to main content

Questions tagged [arraylist]

A simple collection data type found in some languages / platforms (such as in Java or .NET). The array list implements a list using an array, benefiting from both the DSs strengths.

arraylist
Filter by
Sorted by
Tagged with
0 votes
0 answers
41 views

I am trying to add all adjacent edit texts in each row of a recycler view and display the result of adjacent sums in each text view of that row. The issue is when my app launches everything seems fine ...
kaismaqbool hakim's user avatar
Best practices
0 votes
4 replies
128 views

I have a list of ranges that consist of a start and end value. I need to optimise the list by identifying any overlapping ranges and merging them so that there is no duplication on the list. I have ...
Michael's user avatar
  • 507
-1 votes
3 answers
114 views

I am working on a LeetCode question. I am able to solve it using other approaches but not via this approach. I am trying to reverse a singly linked list recursively. When I run the code, my output for ...
Sakib's user avatar
  • 45
0 votes
1 answer
90 views

I have tried using both base class and interface and in both instances I am told a constructor that takes my arguments does not exist. I have two classes that are related to each other and I want to ...
horsemeat's user avatar
0 votes
1 answer
163 views

How can I make an array of variables generated using the values passed through a while loop ? I am using osclass for a uni project and I find no way whatsoever to make a list os usable variables from ...
Rob Wall's user avatar
1 vote
1 answer
76 views

Consider the following simple ArrayList implementation: ...
JosEduSol's user avatar
  • 5,498
5 votes
3 answers
212 views

I'm currently filtering a Java List to keep approximately a percentage of its elements using a random approach: ...
user30654079's user avatar
1 vote
1 answer
93 views

My macro accurately creates 2 lists of numerical data based on which group (control or exposed) a subject is in. ...
LyleBabcock's user avatar
1 vote
1 answer
71 views

I have a list of 36 subjects and their ages, and whether they are in the 'Control' or "Exposed" group. I am trying split this list into two based on what group they are in. The program ...
LyleBabcock's user avatar
3 votes
3 answers
412 views

How does cache locality impact the performance of ArrayList compared to LinkedList in Java? I've often heard that ArrayList has an advantage in terms of cache locality, but I don't fully understand ...
Marat Tim's user avatar
0 votes
1 answer
87 views

Concerning Javascript, I've been trying to understand backtracking lately and it's really confusing. Specifically, I've been trying to understand the permutation problem, which when given an array, we ...
ContravariantMind's user avatar
3 votes
2 answers
186 views

I'm working on an assignment where I need to take "books" from the user(a title, an author, and ISBN number, all strings), and store these books somehow, and then do various things to these ...
Bill H's user avatar
  • 33
1 vote
1 answer
60 views

I have a text property in a class that will contain multiple words along with other properties (index, linenumber, starttime, endtime). I have an arraylist (rawdata) of that class built. I need to be ...
James Parks's user avatar
1 vote
1 answer
99 views

I have created a void method which prints out the required responses from an url (using Java and Playwright) but I actually need to receive these values for making junit assertions and I am trying to ...
Mina's user avatar
  • 85
2 votes
3 answers
283 views

In some code from my company, I've read a list initialization: List<SomeClass> someClassList = new ArrayList<>(Collections.emptyList()) What does it ...
Corporativo's user avatar
0 votes
1 answer
75 views

For this assignment I'm supposed to test my quicksort class using a variety of different pivots and a variety of ArrayLists in different arrangements. The class works fine with a random pivot, or a ...
Drake's user avatar
  • 11
2 votes
3 answers
96 views

I have a Java code for booking movie tickets. In this program, each person can only buy two tickets, a maximum of 10 tickets are sold and at the end it displays a list with the names of the people. I ...
Cleyton Melo's user avatar
0 votes
0 answers
56 views

For the life of me I cannot pull a simple String ArrayList from my generic hashmap: HashMap<String, Object> I have been able to pull much more complicated structures such as List of objects ...
Mark Park's user avatar
1 vote
4 answers
148 views

A total Java rookie here, I'm wondering if there's any way I could iterate over several arrays like: myArray1 myArray2 myArray3 by doing some form of "...
Marian Kay's user avatar
1 vote
2 answers
94 views

Currently I have the below code creating a multidimensional arraylist (but I am not married using arraylists, just need a free-to-add to array type): ...
user66001's user avatar
  • 950
0 votes
0 answers
30 views

How do I extract image urls from a file arraylist and add the corresponding bitmap to a bitmap arraylist. I've blocked out what I think is close: ...
garrettlynchirl's user avatar
0 votes
0 answers
39 views

I have two arrays both contain 12 elements. I want capture the elements with the indexes of 0, 5, 10 and store them in a new variable, but I've noticed my filtering does not work if I change some of ...
Dumile Chiwuta's user avatar
5 votes
2 answers
161 views

I made a very simple program with a GUI where the user inputs the file name and the program itself calculates the mean of a file containing numbers only. I did this by creating a function that reads ...
mtldev1642's user avatar
0 votes
1 answer
279 views

I'm working on a Spring Boot application that needs to map a JSON column in my MySQL database to a Java entity using Hibernate. I am using the @Type annotation from the Hibernate Types library, but I'...
Ay3sh's user avatar
  • 3
-2 votes
1 answer
93 views

I have a Class B defined as below --> ...
rishi007bansod's user avatar
0 votes
1 answer
106 views

I need help, for group by my XML object class. Here my data from SQL server, my Query ( select * from TaxXMLdb ) = TIN DocEntryAR BuyerDocNum BuyerName Opt ItemCode Name DocEntryAR2 AAA 100100 5533 ...
valen's user avatar
  • 3
2 votes
3 answers
151 views

The following code is meant to loop through a txt file and create a list of recipes that each have a name, cooking time and ingredients, which are themselves put on a list ...
Felix_is_coding's user avatar
0 votes
1 answer
46 views

My program has 5 classes: 1 - Abstract class Animal public abstract class Animal { } 2, 3 - Classes that extend an abstract class ...
Serg's user avatar
  • 13
1 vote
0 answers
57 views

I have created an Arraylist of items. Once an item is selected, it goes to a new activity for the price to be calculated once the quantity is selected. Upon clicking cart, it goes to another activity ...
Just Learning's user avatar
0 votes
0 answers
119 views

I'm not sure what happened when saving a file, but now when I try to load it I get java.io.EOFException. All of the code is in try/catch blocks but there was no error when saving the file. Opening the ...
vincatzero's user avatar
-1 votes
1 answer
69 views

This image contains Question Sorry can't provide in text as it can not be copy from the platform enter image description here This is what I tried Test cases I was Having Problem solving Test case 2 ...
Tanishq Uppal's user avatar
0 votes
1 answer
61 views

on firefox or chrome. open the console let arr = [] arr.push(window.open('https://google.com')) arr.push(window.open('https://twitter.com')) ...
heluanyongyong's user avatar
0 votes
0 answers
46 views

there's this thing where the program has to automatically change an item's column's value in a table based on their Type ID. Basically -Maintenance Sched Table has Type ID and No. of Days -Items Table ...
Reyes RK's user avatar
0 votes
0 answers
26 views

I try to manage an Array list of AccessCodes, which are a simple class. In the class Robot I want to get access of one element of the ArrayList and use the method getUsed(), which is defined in the ...
user28181162's user avatar
-5 votes
1 answer
109 views

I'm reading two CSV files from my computer and filling an arraylist with this data. Then I compare these two arraylists to find matches. If the CSV files contain up to 20 lines, then there are no ...
Дмитрий Сергеевич's user avatar
0 votes
2 answers
133 views

I want my program to take an integer and put every prime number up to that integer into an ArrayList. Logically I can't find why it doesn't work. ...
Scott Burkhart's user avatar
0 votes
1 answer
592 views

Using Zig, as a new to the language, trying to perform few simple actions on a file. I have a function with the purpose of getting a path to a file and returning path to a sorted file. The function ...
avifen's user avatar
  • 1,136
-2 votes
1 answer
93 views

I have a response. I need to get the functionAmount when functionType = limit. I have the hard coded here. How to convert this into dynamic. How to filter data from nested objects? ...
TestUser's user avatar
  • 213
-2 votes
1 answer
856 views

I am trying to write an endpoint to return all the data in a seperate JSON file. This is my code for now. UserController.java ...
lse23's user avatar
  • 1,857
-1 votes
1 answer
258 views

I'm writing a .vbs script for an application on Windows. The problem is that the ArrayList is used inside the script. MDSN states that the .NET Framework 4.8 installed is sufficient to use ArrayList. ...
Ivan Serdukov's user avatar
1 vote
2 answers
110 views

I want to loop through an array with an if statement and only after it has looped through the entire array execute the else. This is how i have my code now ...
PaN1NI's user avatar
  • 39
3 votes
1 answer
65 views

My code gives me this incorrect output: ['CT', 'X', 'Z'] [100, 1.0583, 1.0633] [200, 3.012, 5.873600000000001] [300, 1.79, 2.5220000000000002] ['Total', 0, 0] The ...
Elektvocal95's user avatar
0 votes
0 answers
41 views

I am a C# developer in my day job and I'm working on a side project in Kotlin while trying to learn the language. I am consolidating ArrayLists into a single ArrayList using a class like this. ...
Mr. Anderson's user avatar
-3 votes
1 answer
64 views

I wanted to write a recursive function that calculates the sum of the elements in an array, but when I pass the array to the function, it thinks that I passed an integer and writes that there is no ...
noname's user avatar
  • 7
-3 votes
1 answer
55 views

java.lang.ClassCastException: android.widget.Button[] cannot be cast to android.widget.Button at &...
Muhammad Hasnain Munir's user avatar
0 votes
1 answer
83 views

I am trying to send some image files, an array and a list with Ajax, but when I read it in the maintainer, it does not pass me the values ​​of the list, the value is null. The program is developed in ...
Fernando Diaz's user avatar
1 vote
1 answer
286 views

I am migrating an application from View to Compose. The application was written in Java so I need to migrate the UI to Kotlin. I prefer to do it as gradually as possible so I'm leaving the ViewModel ...
Shaul's user avatar
  • 469
0 votes
1 answer
73 views

I would like to add multiple types of classes to a List to use it in a DataTable later on. My desire is to sort the specific columns and use buttons inside of it later on to do some actions. How do I ...
Tech RCV's user avatar

1
2 3 4 5
692