question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

simple-linked-list: unnecessary generic method

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rstockbridgecommented, May 20, 2017

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 https://github.com/rstockbridge. I’m happy to make a PR for it unless you want to @rstockbridge https://github.com/rstockbridge? 😃

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/exercism/xjava/issues/568#issuecomment-302876617, or mute the thread https://github.com/notifications/unsubscribe-auth/AIXZzRAoZHAhsO63DspOMuZXYH3ANq9tks5r7vjdgaJpZM4NajMW .

1reaction
FridaTveitcommented, May 20, 2017

I’ve looked at this and I agree with @rstockbridge. I’m happy to make a PR for it unless you want to @rstockbridge? 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found