About 108,000 results
Open links in new tab
  1. java howto ArrayList push, pop, shift, and unshift

    Nov 4, 2022 · I've determined that a Java ArrayList.add is similar to a JavaScript Array.push I'm stuck on finding ArrayList functions similar to the following Array.pop Array.shift Array.unshift I'm leaning to...

  2. java - Create ArrayList from array - Stack Overflow

    Oct 1, 2008 · If you look, Arrays ISN'T returning a true java.util.ArrayList. It's returning an inner class that implements the required methods, but you cannot change the memebers in the list.

  3. Usage of Iteration's .hasNext(); and .next(); methods in Java

    Sep 11, 2020 · Exception in thread "main" java.util.NoSuchElementException This is the Exception. That's why hasNext () method is used as it checks whether an element is there or not. you can …

  4. How to Pass an ArrayList to a Method in Java? - Stack Overflow

    Mar 8, 2020 · Your method declares that it takes an object of type ArrayList, a class from the Java Collections Framework. The ArrayList class happens to use an array internally, but is not an array itself.

  5. java - How to create a method that returns an ArrayList - Stack Overflow

    2 Create a Object of a ArrayList and pass reference to different methods. Example create a ArrayList Object in main class and pass it to addString & display method.

  6. How to create an 2D ArrayList in java? - Stack Overflow

    Jun 6, 2013 · 61 I want to create a 2D array that each cell is an ArrayList! If you want to create a 2D array of ArrayList.Then you can do this :

  7. Java Returning method which returns arraylist? - Stack Overflow

    Jul 27, 2012 · Java Returning method which returns arraylist? Asked 13 years, 4 months ago Modified 3 years, 6 months ago Viewed 382k times

  8. java - equivalent to push () or pop () for arrays? - Stack Overflow

    Nov 13, 2013 · In Java the package java.util contains all kinds of data structures that can handle adding and removing items from array-like collections. The classic data structure Stack has methods for …

  9. java - Making a method which returns an ArrayList - Stack Overflow

    Oct 5, 2021 · What i want that the methods does is creating and adding a doctor object to a list (which exists in the main). Ive tried your approach, but i changed the parameter ArrayList<String> to …

  10. Type List vs type ArrayList in Java - Stack Overflow

    Feb 17, 2010 · Something to note is that "ArrayList specific methods" isn't limited to just methods used in ArrayList, but their return types being changed as well (will cause a NoSuchMethodException …