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
34,597
questions
-1
votes
0
answers
27
views
How to see if arraylist of a class contains a specific value [duplicate]
I am working on a java project, I have an ArrayList of a custom class with two variables (a boolean and char) I need to check if it contains a specific char. How do I get it to check the char of it.
...
-1
votes
0
answers
92
views
Check if two values in an array are the same [closed]
Here is my code so far (implements a similar algorithom for Wozmon in java)
import java.util.ArrayList;
import java.util.Scanner;
public class rom {
static ArrayList<Integer> address = new ...
0
votes
2
answers
42
views
Building a C# equivalent of the SQL Server construct IN?
Often in SQL Server, I use IN to check if a value is in a list of items, for example:
WHERE @x IN (1, 2, 3, 5, 8, 13)
I've got as close as I can by defining the following in a library function, thus:
...
0
votes
1
answer
28
views
How to remove "Exception has occurred" [FLUTTER]
When requesting to the Internet - API
I check if there is a trailer there and if there is, it shows a button
But it shows an error, and it doesn’t always show it. It shows only on some individual ...
0
votes
0
answers
42
views
How do I export a list as an Excel file using openpyxl?
I am working on a proof-of-concept script where I take an Excel spreadsheet and import it to a list in Python using the openpyxl module. I then make some changes to the data in the list, and export ...
-1
votes
4
answers
82
views
ArrayList sublist method clarification
This is regarding the usage of subList method in an ArrayList.
Consider I am having an array as below:-
int[] prices = {71,11,65,99,21,82};
I am converting the above array to arrayList as below:-
...
0
votes
0
answers
26
views
How do I fix this nullPointException exception in my program? [duplicate]
I'm trying to create a simple card game where the user faces against a computer (which is a class in my method that takes its turn automatically after the user), but I'm encountering a ...
-1
votes
1
answer
112
views
Performance of ArrayList<Integer> versus int[]
I have a million ints that I want to store in a data structure. I wanted to know whether the int array (int[]) is any more efficient than an ArrayList. Are there any performance gains to using int[] ...
1
vote
1
answer
21
views
Remove a specified element from the produced array of class objects
I want to remove a certain element from the created array of class objects. The code is provided below here.
DbParameter[] Parameters =
{
new DbParameter { Parameter = "ExamYear", Value =...
-4
votes
1
answer
64
views
Why is my code giving wrong answer when using 2d ArrayList and passing when using 2d arrays?
Here is the DP question,
Given a ‘N’ * ’M’ maze with obstacles, count and return the number of unique paths to reach the right-bottom cell from the top-left cell. A cell in the given maze has a value '...
-1
votes
2
answers
42
views
Type mismatch: inferred type is OnSuccessListener<ArrayList<myClass?>> but OnSuccessListener<in ArrayList<myClass>!> was expected
I am trying to convert Java code to Kotlin code but in a code segment in particular it seems is not posible to fully convert.
I am getting a Build error:
Type mismatch
Required: OnSuccessListener<...
0
votes
1
answer
71
views
enum float problem calculating price of coffee [closed]
package Main;
import java.util.ArrayList;
import java.util.List;
public class Main {
List<Ingredients> ingredients = new ArrayList<>();
public enum Ingredients {
...
1
vote
3
answers
122
views
Which List implementation does Kotlin use when calling listOf()
As known, in Java List is not a class, but an interface, so you can't get an instance of a List, you have to specify the implementation, like ArrayList, LinkedList, etc. So here is the question: which ...
0
votes
1
answer
49
views
how to connect a Arraylist to one Index from an another Arraylist
im a bigginer for coding and java. Im now learning about Hashtable.
What im struggling here ist to connect a ArrayList to one of the index from an another ArrayList.
a simple image of what I want to ...
0
votes
1
answer
24
views
Error :- lateinit property itemsList (ArrayList) has not been initialized, HomeFragment, Kotlin
I am trying to create a story Book app with Kotlin but I am beginner and learning programing. and I try to create this app with local Json file (loadJsonFromAssets) with glide, in home fragment, but I ...