Skip to content
Advertisement

Tag: arraylist

Java: Arraylist of Array

I want to make an arraylist of an array of 2 elements. So, I have unknown rows and known columns (i.e. 2). E.g. [{name1, ID1}, {name2, ID2}, …] I also have to return this arraylist. I tried using but don’t know how to proceed. Please advise. Answer When you define a ArrayList must use a class. In this case, you

Multiple filters applied to a single list in Java 8+

How can be achieved to pass a “list of filters” to a stream in Java 8, instead of applying them individually as illustrated in the following example? https://howtodoinjava.com/java8/stream-multiple-filters-example/ The purpose would be to dynamically create a list of filters, one way would be to iterate through a list of filters and apply it to the list to be filtered. Any

How to remove an item from List?

I’m developing an app, which contains a list of tickets, there are add ticket and remove ticket options for the user. The add option works fine, but the remove option doesn’t, here is the ticket list code The delete function in another activity which doesn’t work: While the add function works fine: Can anyone tell me what’s wrong with the

Split a List of Lists with camel splitter

I have many ArrayLists created to hold the collections of separate entities to be split in to their own entities. these are added to an ArrayList then pushed to the exchange where I try to split the List of Lists. I can’t seem to split a list of lists. Tried many variations of the Splitter, with tokens, etc. after collecting

How to initialize List Of List in one line [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago. This post was edited and submitted for review 11 months ago and failed to reopen the post: Original close reason(s) were not resolved Improve this question How can

How to get List from Object in Spring RestTemplate

How to get List from Object? Below you can find my code: Actually object variable is a List of Objects(Strings) and I need to get all these Strings. If I print it out System.out.println(object.toString()); it looks like that: I need to get List of these Strings to dynamic use it. Could you please help? Answer Try this out. This should

Advertisement