Splice an ArrayList in Java similar to Node Js

In the Node Js code , we have the “stopTimeFrame()” method as below : public stopTimeFrame(timeFrameIdentifier: number): number { const startTimeStamp = this.timeFrames.splice(…

AndroidStudio: java. How can i return an arraylist to main activity?

I tried this way: The application stops working on setResult only when the arraylist is not empty. SECONDARY ACTIVITY Intent d = new Intent(); d.putExtra(“cat”,(Serializable) category….

Loop through an Arraylist and show objects that fills the conditions Java

I have certain objects stored in an ArrayList. Every object has 5 variables (two strings, two ints and a double). The method I’m trying to write will ask the user to input a value (double). It will …

Generate a random according to criteria [closed]

I have a JSON File (ArrayList) with some Restaurants and km(miles) from my Workplace to the Restaurant. The User can choose how far away the Restaurant should be (5km, 10km..) after that should the …

Acces an ArrayList on a different method (same class)

im trying to acces the ArrayList “Lista” (with the modifications it had in the “Guardar” method) in the “verJugadores” method, is this possible? When I print the …

Sort List of Strings arrays in Java

I’m trying to make a program that consists of an array of Strings . now I need to sort them in order ‘PJ’, ‘GHS’, ‘FJ’, ‘PAS’ and date. input : listOfStringArrays.add(new String[] { “200608&…

Load an ArrayList with nested ArrayLists from a file using Java

I have an arraylist like ArrayList>. I have saved my main ArrayList in a text file by using the following code. ArrayList> ar2 = new …

How is the ArrayList add(Type value) method O(1) amortized time complexity?

Most implementations of the ArrayList use an array internally and when the size is already exhausted upon adding an element to the list, it resizes or “grows” by essentially doing the …

I need an algorithmic help to convert an input Array object to ArrayList<List> object? [closed]

I need an algorithmic help to convert an input array in Java having this content : {5,6,3,2,4,7} To this format : [[2, 3], [3, 4], [4, 5], [5, 6], [6, 7]].

Cannot invoke “ ” because array is null

I need to add information about 2 actors such as their name, address and age and have done so without arrays easily but it’s necessary, I keep getting the error “Cannot invoke “TestActor….