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

Sign up
Appearance settings

Commit 61144d3

Browse files
Update README.md
1 parent 5e10b63 commit 61144d3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@
3030
<span style="font-family: Verdana, sans-serif;"><a href="http://www.javaguides.net/2018/08/java-generics-upper-bounded-wildcards.html" target="_blank">Java Generics Upper Bounded Wildcards Example</a></span><br>
3131
<a href="http://www.javaguides.net/2018/08/java-generics-lower-bounded-wildcards.html" target="_blank"><span style="font-family: Verdana, sans-serif;">Java Generics Lower Bounded Wildcards Example</span></a></div>
3232
</div>
33+
34+
SINCE Java 5, generics have been a part of the language. Before generics, you had to cast every object you read from a collection. If someone accidentally inserted an object of the wrong type, casts could fail at runtime. With generics, you tell the compiler what types of objects are permitted in each collection. The compiler inserts casts for you automatically and tells you at compile time if you try to insert an object of the wrong type. This results in programs that are both safer and clearer, but these benefits, which are not limited to collections, come at a price. This chapter tells you how to maximize the benefits and minimize the complications.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /