Gennetics的Java原始类型和参数化类型 [英] The java raw type and parameterized type of Gennetics

查看:49
本文介绍了Gennetics的Java原始类型和参数化类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!
大家好,我是Java初学者!
我正在阅读Java中的Thought.但是,令我困惑的是,在Java Genetics中是原始类型和参数化类型.
您知道,在Collection类中,我们可以这样做:

Hello!
Everyone,I am a java beginner!
I am reading the Thinking in java.But, to my confusion,in java Genetics,is the raw type and parameterized type.
you know,in the Collection class ,we can do this:

List<String> l=new ArrayList<String>();



是的,但是,我发现在new ArrayList<String>()中,<String>可能毫无意义.
例如,如果我们写:



yes,but,I found that in the new ArrayList<String>(),the <String> likely make no sense.
For example,if we write:

List<String> l=new ArrayList();



没关系.
我想知道原因. 谢谢.



it`s OK.
I want to Know the reason.
Thanks.

推荐答案

您的问题不是很清楚,但是您可能会发现
Your question is not very clear, but you may find this tutorial[^] helps to answer your query.


结构!

开发软件是关于结构的.拿一些.

并请阅读以下内容:
java泛型中的一些困惑 [ ^ ]

因为这几乎是一个相同的问题.
Structure!

Developing Software is all about structure. Get some.

and please read this: A little confusion in java Generics[^]

As it''s pretty much the same question.


这篇关于Gennetics的Java原始类型和参数化类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆