Skip to content
Advertisement

Tag: arraylist

How to return arraylist vertically

I am trying to return an array list vertically but I’m having some issues trying to implement it. Below is my code, and the return results; Output is what I’m trying to get to be vertically } My current output is [2, 4, -1] I’d like it to be Any help would be appreciated. Thank you in advance Answer Hi

How to create a functioning program that acts like a calendar with methods that block multiple ranges of dates and return the available dates?

The following is what I was able to complete: For the setBlockDates() method: write a method to block multiple ranges of dates from the dateRange ArrayList. Here I should be able to enter multiple ranges to block, such as ([1,4], [8,11], [17,24]) For the getAvailableDates() method: write a method to return the available dates in the dateRange ArrayList created below.

Select Random element from ArrayList print then remove It

Hi so I have this array list of questions and I want to choose it randomly then delete it one by one until there’s no more so that It wont load the same question twice but there is some problem for example I have 3 questions in the question arraylist sometime it only loads 1 or two even the same

Sorting an arraylist with lambda function isn’t working

I’m trying to use .sort() method with an arraylist. My method public void sortSurname() should sort alphabetically all the objects by their surname, these objects are contained in an arraylist ArrayList<Contact> contacts. Could someone please find the issue with this code? Here is what I’ve written so far: Contact class Rubrica class Main Thank you for the help. Answer The

Advertisement