Category "arraylist"

How to read a file from internal storage or external storage and store the file in a arrayList in android

My requirement is the end-user must be able to upload files into the application from internal or external storage and finally display the name of the file in t

searching in arraylist always not found

no matter what I use indexof() or contains or .equals() changing everything to uppercase or to lowercase It always return false and not found can someone please

Binary Gap Program in Java

My problem statement: A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the b

Resultset To List null [duplicate]

public List<Order> getAllOrdersByCustomerId(int customerId) throws SQLException { List<Order> AllOrdersByCustomerId = new Arra

Odd number Sequence Replaced by Count

I am working on java Program here is program Question: Consider Java Program. It reads integers from the standard input (until it gets a negative number) and

convert List of List to list float

I have a list of list of coordinate with data type of float for example something like this [[106.4372634887695, -6.3303128514375], [106.4372634887695, -6.32997

how to Save Inputted Values ​from Edittext into Array?

I am making a program to get Values ​​from edittext and store it in an array then I want to display that array on screen and here is my command Edi

Unity C# error: (12,47): error CS1503: Argument 2: cannot convert from 'System.Collections.Generic.List<UnityEngine.GameObject>' to 'float'

I'm new to programming in general. With another Script i store in the list "spawnPointC" all gameobjects called spawnPointC that appear from spawning other pref

java.util.Arrays.asList when used with removeIf throws UnsupportedOperationException

I am preparing for an OCPJP 8 exam for the next 2 months and currently I this one got my attention as I dont understand why public class BiPredicateTest { p

Search an array list inside another array and return a new object combined

I am using typescript and I have two objects: export interface Module { moduleId: String name: String } export interface Model { id: number name

Partition negative and positive in an array in java using shift operator

You will be given an array of n integers, both negative and positive. You need to partition the array into positive and negative numbers. Add all the positive i

if the data is the same add it to the array only one time

I have predefined addresses (address1,address2 and address3) and i want to : If each address variables is equal to the first 6 variables of my data then i want

How to add items to a list of lists

I aim to print a list of lists containing entry and exit times in the 24 hour decimal format from the "AM"-"PM" String format input by the user as a String arra

When trying to overwrite a equals method in Java, it won't compare the values only the object itself?

In this exercise, I need to create a equals() method for a Drink class. Two drinks are the same if they have the same name and same size. I am receiving false f

Java ArrayList Copy Changing Original Value

I have copied an ArrayList as I want to keep original values of my source Arraylist. If I change first item of my source ArrayList, it automatically changes fir

How to use add() in ArrayList class in Java

I have a question about constructing an ArrayList, I have had a Car Class, now I need to make an ArrayList to put content in, I named it as Race, please see cod

ArrayList equality in junit not working although expected and actual are similar

I am using below test method to check whether the Arraylist is sorted as expected. @Test void compareFields() { Assignment14 assignment14 = new Assi

How to iterate through an array list on a JSP without JSTL

//I have retrieved a Result from MySQL and created and Array-list User .i have sent this //US er Array-list in and sent it through request Response Object. Now

How do I initialize a two-dimensional List statically?

How can I initialize a multidimensional List statically? This works: List<List<Integer>> list = new ArrayList<List<Integer>>(); But

Spinner does not show selected value

I have implemented the spinner by populating the array list through database.I can get and show the array list in my spinner array adapter but if I select the i