Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不太理解“泛型”的“逆变”中这句话“因此,如果可以摆脱静态泛型方法,那么在读取时就不需要协变类型了。 ” #376

Open
dellenovo opened this issue Feb 6, 2020 · 0 comments

Comments

@dellenovo
Copy link
Contributor

@dellenovo dellenovo commented Feb 6, 2020

我原来还以为例程中的static修饰符有什么影响, 但是去掉后, 我new一个GenericReading的实例后,也能正常使用f1()。
GenericReading genericReading = new GenericReading();
genericReading.f1();
总之,不理解这里作者说要“摆脱静态泛型方法”的用意。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.