Skip to content
Advertisement

Tag: arraylist

Finding the longest word ArrayList /Java

I want to write a method which finds the longest String (word). The output should be the longest word in case of two words with the same lenght the output should be: “More than one longest word”. I used ArrayList and almost had a solution, but something goes wrong. The case is that I have a problem when two words

Implementing a printAnimals method

I am trying to implement a printAnimals() method that prints the ArrayList for dogs or prints the ArrayList for monkeys, or prints all animals whose training status is “in service” and whose is Not reserved, depending on the input you enter in the menu. I am trying to correctly write a for loop for both ArrayList that contains if statements,

How to send variable to method through an arraylist

I’m not very good at explaining things but can someone try to explain to me why my user input variables are not being sent to my methods in another class? This is my main class: } This is an example of one of my subclasses that I am trying to send the variables to. All the other ones are the

creating exploitable .csv file for java program

I’m both new to JAVA and .csv file so bear with me please! Here’s my problem, i have this word file : basically i have a theme (here Science) a difficulty level, a question number, a question, available answers and a right answer I would like to be able to create a .csv file that i could then exploint in

Create and find highest value in subarraylist

I have an Arraylist of the Cells from an Excel sheet. I want to create subarraylists of size 50 from the Arraylist of Cells I actually have, beginning from the index of 1590 and ending with size()-700. I want to get the highest number from every subarraylist and put it in the new Arraylist. in the new Arraylist there should

Advertisement