Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History

Generics

在任何重要的软件项目中,出现bug是日常。认真的计划,编码和测试可以减少bug的出现,但是bug总是时不时的出现在你的代码中。尤其是伴随着功能的新增你的代码量和复杂度也随之增加bug也随之而来。

幸运的是有些bug是容易发现的。比如,编译时bug就能被很早发现,你可以使用编译器的报错信息来确定问题所在并立即修复它。但是运行时bug会造成更大的麻烦,它们不会立即显现出来,当它们发生时,代码的位置可能和实际问题的原因相去甚远。

Generics(泛型)通过在编译时让你的bug更容易被检测而使得你的代码更加稳定,通过本章的介绍,你可以继续看Gilad Bracha教程

Morty Proxy This is a proxified and sanitized view of the page, visit original site.