simple-linked-list: unnecessary generic method
See original GitHub issueI believe that the example solution unnecessarily uses a generic method when entire class is generic. Specifically it seems to me that private <T> T[] newArray(Class<T> clazz, int size)
can be replaced by private T[] newArray(Class<T> clazz, int size)
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Linked List using generics, getting "not applicable arguments ...
add('B'); , I get the following error: The method add(Node) in the type LinkedList is not applicable for the arguments (char) . What...
Read more >Javanotes 8.1.3, Section 10.5 -- Writing Generic Classes and ...
Now, it's time to learn how to write new generic classes and methods from scratch. ... be almost identical, which seems like a...
Read more >ogp-notes/generics.md at master - GitHub
Generics. Basic concept. In this note, we introduce Java's support for generic classes, ... Suppose we add the following static method to class...
Read more >4.1. Generic Types - Java in a Nutshell, 5th Edition [Book]
Generic types and methods are the defining new feature of Java 5.0. A generic type is defined using one or more type variables...
Read more >Collections and Generic Data types
Pizza: 1996-97, extended Java with generics, function pointers, class cases and pattern matching ... List<Integer> l = new LinkedList<Integer>();.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Go ahead! 😃
On Sat, May 20, 2017 at 10:29 AM, FridaTveit notifications@github.com wrote:
I’ve looked at this and I agree with @rstockbridge. I’m happy to make a PR for it unless you want to @rstockbridge? 😃