About 50 results
Open links in new tab
  1. How to have Java method return generic list of any type?

    Mar 8, 2017 · I would like to write a method that would return a java.util.List of any type without the need to typecast anything: List<User> users = magicalListGetter (User.class); List<Vehicle> veh...

  2. 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

  3. How does `Java` `List` method `size` work? - Stack Overflow

    Apr 24, 2019 · A reasonable implementation for a size() method on a java.util.List implementation would be to initialize an instance member of type int to zero and increment/decrement it appropriately as …

  4. Method List in Visual Studio Code - Stack Overflow

    Mar 22, 2016 · Visual Studio Code market place has a very nice extension named Go To Method for navigating only methods in a code file. Hit Ctrl + Shift + P and type the install extensions and press …

  5. Java List `of` method is quite confusing - Stack Overflow

    Mar 9, 2019 · Java docs are poorly written. There are no examples, just a list of flags. Github went a step down: used vague names for the flags and spits errors, but doesn't suggest solutions. When I …

  6. How can I pass List in my method parameter? - Stack Overflow

    Jul 17, 2016 · Can someone explain how to define a List parameter such that i can pass a List to it. My method looks something like this. I need LIST to be replaced so the method recognizes "listname" as …

  7. Convert list to array in Java - Stack Overflow

    How can I convert a List to an Array in Java? Check the code below: ArrayList<Tienda> tiendas; List<Tienda> tiendasList; tiendas = new ArrayList<Tienda> (); Resources res = this.

  8. Method has the same erasure as another method in type

    The key is that this is a language rule designed to maintain compatibility with old code using raw types. It is not a limitation required by the erasure of type parameters; because method resolution occurs at …

  9. Generic type as parameter in Java Method - Stack Overflow

    Jul 20, 2011 · Generic type as parameter in Java Method Asked 14 years, 6 months ago Modified 2 years, 10 months ago Viewed 160k times

  10. java - LinkedList remove method - Stack Overflow

    Nov 7, 2008 · Are you asking for the name of a method in the api? That answer would simply be remove, assuming you are asking about java.util.LinkedList which is in fact a double linked list.