About 51 results
Open links in new tab
  1. Java Returning method which returns arraylist? - Stack Overflow

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

  2. java - How to return an arraylist? - Stack Overflow

    Jan 27, 2012 · 0 Any method that isn't void can return any type of data, however, you can only return types the method allows. For example, a method beginning with public int can only return an int …

  3. java - return an ArrayList method - Stack Overflow

    Oct 24, 2013 · return an ArrayList method Asked 12 years, 3 months ago Modified 8 years, 2 months ago Viewed 96k times

  4. java - How to return an arraylist from a method - Stack Overflow

    Sep 20, 2010 · Just as a comment, it is considered good practice in general to return a List rather than an ArrayList, in case you need to change the implementation at some point.

  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. java - How to return an ArrayList <Integer>? - Stack Overflow

    Dec 20, 2015 · public static ArrayList<Integer> getHailstoneSequence(int n) { ^ this part is mandatory for my assignment, so it is necessary for me to work with an ArrayList of Integers. I am struggling to …

  7. java - How to return a new ArrayList? - Stack Overflow

    Apr 7, 2013 · ArrayList<Student> studentList = new ArrayList<Student>(); Which is populated from a text file, with five pieces of information per object. One of the pieces of information is the "grade". I want …

  8. java - How to return an ArrayList with an recursive function - Stack ...

    Mar 4, 2016 · How to return an ArrayList with an recursive function Asked 11 years, 1 month ago Modified 9 years, 11 months ago Viewed 25k times

  9. java - Initialization of an ArrayList in one line - Stack Overflow

    Jun 17, 2009 · ArrayList<String> list = new ArrayList<String>() {{ add("A"); add("B"); add("C"); }}; However, I'm not too fond of that method because what you end up with is a subclass of ArrayList …

  10. java - Create ArrayList from array - Stack Overflow

    Oct 1, 2008 · As of java 8, Collectors.toList() will return an ArrayList. However this may differ in future versions on java.If you want a specific type of collection then use Collectors.toCollection() instead …