{"id":2498,"date":"2026-09-24T09:00:00","date_gmt":"2026-09-24T09:00:00","guid":{"rendered":"https:\/\/otus.ru\/journal\/?p=2498"},"modified":"2026-09-25T15:30:37","modified_gmt":"2026-09-25T15:30:37","slug":"poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah","status":"publish","type":"post","link":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/","title":{"rendered":"\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0432 Java: \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b"},"content":{"rendered":"<p><strong>\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 (generics)<\/strong> \u0432 Java &#8212; \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u043e\u0432: \u043a\u043b\u0430\u0441\u0441, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0442\u0438\u043f\u0430 (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">&lt;T&gt;<\/code>), \u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">String<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Integer<\/code>) \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438. \u041d\u0443\u0436\u043d\u044b \u043e\u043d\u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0448\u0438\u0431\u043a\u0443 \u00ab\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043d\u0435 \u0442\u043e\u0442 \u0442\u0438\u043f\u00bb \u043b\u043e\u0432\u0438\u043b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0430 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0438 \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0434 \u043d\u0435 \u0431\u044b\u043b \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0440\u0443\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f\u043c\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">(String) obj<\/code>.<\/p>\n<div class=\"oj-toc\" style=\"background:#f6f6f6;border-radius:8px;padding:14px 20px;margin:20px 0\">\n<p><strong>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/strong><\/p>\n<ol>\n<li><a href=\"#s1\">\u041c\u0438\u043d\u0438-\u0441\u043b\u043e\u0432\u0430\u0440\u044c: \u043f\u044f\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0443\u0442\u0430\u044e\u0442<\/a><\/li>\n<li><a href=\"#s2\">\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u044b \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438: \u043e\u0448\u0438\u0431\u043a\u0430 \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435<\/a><\/li>\n<li><a href=\"#s3\">\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440: \u043a\u043b\u0430\u0441\u0441, \u043c\u0435\u0442\u043e\u0434 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"#s4\">\u0418\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c: \u043f\u043e\u0447\u0435\u043c\u0443 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Integer&gt;<\/code> &#8212; \u043d\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Number&gt;<\/code><\/a><\/li>\n<li><a href=\"#s5\">Wildcard: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">? extends<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">? super<\/code> \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e PECS<\/a><\/li>\n<li><a href=\"#s6\">\u0421\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0438 \u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f<\/a><\/li>\n<li><a href=\"#s7\">Raw types \u0438 \u0437\u0430\u0433\u0440\u044f\u0437\u043d\u0435\u043d\u0438\u0435 \u043a\u0443\u0447\u0438<\/a><\/li>\n<li><a href=\"#s8\">\u0421\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043e\u0431 \u0438\u043c\u0435\u043d\u0430\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/a><\/li>\n<li><a href=\"#s9\">\u0415\u0441\u043b\u0438 \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f: \u0441\u0438\u043c\u043f\u0442\u043e\u043c -&gt; \u043f\u0440\u0438\u0447\u0438\u043d\u0430<\/a><\/li>\n<li><a href=\"#s10\">\u0412\u044b\u0432\u043e\u0434\u044b<\/a><\/li>\n<li><a href=\"#s11\">\u0413\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \/ \u0441\u0432\u044f\u0437\u044c \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439<\/a><\/li>\n<li><a href=\"#s12\">FAQ<\/a><\/li>\n<\/ol>\n<\/div>\n<p>\u0412\u0430\u0436\u043d\u0430\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430: \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u0412 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0438\u043f\u043e\u0432 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0442\u0438\u0440\u0430\u044e\u0442\u0441\u044f (type erasure), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;String&gt;<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Integer&gt;<\/code> \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f &#8212; \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043b\u0430\u0441\u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">ArrayList<\/code>. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u0432, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0438\u0436\u0435. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b \u043d\u0430 OpenJDK 25.0.4 (Java 25 LTS) 24.09.2026.<\/p>\n<h2 id=\"s1\">\u041c\u0438\u043d\u0438-\u0441\u043b\u043e\u0432\u0430\u0440\u044c: \u043f\u044f\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0443\u0442\u0430\u044e\u0442<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u0422\u0435\u0440\u043c\u0438\u043d<\/th>\n<th>\u041f\u0440\u0438\u043c\u0435\u0440<\/th>\n<th>\u0427\u0442\u043e \u044d\u0442\u043e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code> \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">class Box&lt;T&gt;<\/code><\/td>\n<td>\u00ab\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f\u00bb \u0434\u043b\u044f \u0442\u0438\u043f\u0430 \u0432 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438<\/td>\n<\/tr>\n<tr>\n<td>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0442\u0438\u043f\u0430<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">String<\/code> \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Box&lt;String&gt;<\/code><\/td>\n<td>\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;String&gt;<\/code><\/td>\n<td>\u0442\u0438\u043f \u0441 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c<\/td>\n<\/tr>\n<tr>\n<td>Raw type (\u0441\u044b\u0440\u043e\u0439 \u0442\u0438\u043f)<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List<\/code> \u0431\u0435\u0437 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">&lt;...&gt;<\/code><\/td>\n<td>\u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u043d\u0430\u0441\u043b\u0435\u0434\u0438\u0435 \u0434\u043e Java 5<\/td>\n<\/tr>\n<tr>\n<td>Wildcard<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;? extends Number&gt;<\/code><\/td>\n<td>\u00ab\u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0442\u0438\u043f\u00bb \u0441 \u0433\u0440\u0430\u043d\u0438\u0446\u0435\u0439, \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043c\u0435\u0441\u0442\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"s2\">\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u044b \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438: \u043e\u0448\u0438\u0431\u043a\u0430 \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435<\/h2>\n<p>\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0432 Java 5 (2004). \u0414\u043e \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Object<\/code>, \u0438 \u0442\u0438\u043f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438. \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 (raw type &#8212; \u0442\u0430\u043a \u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u043e Java 5):<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.ArrayList<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.List<\/span><span style=\"color: #ABB2BF\">;<\/span>\n\n<span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">class<\/span> <span style=\"color: #E5C07B\">Main<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">main<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">[]<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">args<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">names<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">ArrayList<\/span><span style=\"color: #ABB2BF\">();      <\/span><span style=\"color: #7F848E\">\/\/ raw type: \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">names<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">add<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\u0410\u043d\u043d\u0430\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">names<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">add<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">42<\/span><span style=\"color: #ABB2BF\">);                     <\/span><span style=\"color: #7F848E\">\/\/ \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0432\u043e\u0437\u0440\u0430\u0436\u0430\u0435\u0442<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">for<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">Object<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">o<\/span><span style=\"color: #ABB2BF\"> : <\/span><span style=\"color: #E06C75\">names<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">s<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #E06C75\">o<\/span><span style=\"color: #ABB2BF\">;         <\/span><span style=\"color: #7F848E\">\/\/ \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">s<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">toUpperCase<\/span><span style=\"color: #ABB2BF\">());<\/span>\n<span style=\"color: #ABB2BF\">        }<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n<span style=\"color: #ABB2BF\">}<\/span><\/code><\/pre>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442, javac \u043b\u0438\u0448\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Note: Main.java uses unchecked or unsafe operations.<\/code> (\u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0431\u0435\u0437 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">java Main.java<\/code> \u0432\u043c\u0435\u0441\u0442\u043e Note \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0447\u0430\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">[unchecked] unchecked call to add(E) as a member of the raw type List<\/code>). \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0441\u044f, \u0430 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0430\u0434\u0430\u0435\u0442:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\">\u0410\u041d\u041d\u0410\nException in thread &quot;main&quot; java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader &#x27;bootstrap&#x27;)\n    at Main.main(Main.java:10)\n<\/code><\/pre>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 &#8212; \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;String&gt; names = new ArrayList&lt;&gt;();<\/code>. \u0422\u0435\u043f\u0435\u0440\u044c \u0442\u0430 \u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">names.add(42);<\/code> \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\">Main.java:8: error: incompatible types: int cannot be converted to String\n        names.add(42);\n                  ^\n<\/code><\/pre>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u043b\u0430 \u0438\u0437 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430 (\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f) \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e (\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430), \u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">(String) o<\/code> \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">for (String s : names)<\/code>. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u044b \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438: \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0431\u0435\u0437 \u0440\u0443\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u043f\u043b\u044e\u0441 \u043e\u0434\u0438\u043d \u043a\u043e\u0434 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432.<\/p>\n<h2 id=\"s3\">\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440: \u043a\u043b\u0430\u0441\u0441, \u043c\u0435\u0442\u043e\u0434 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041e\u0434\u0438\u043d \u0444\u0430\u0439\u043b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0438 \u0444\u043e\u0440\u043c\u044b \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u0432 \u0441\u0440\u0430\u0437\u0443. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043a\u0430\u043a <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Main.java<\/code>, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">java Main.java<\/code> (Java 11+ \u0443\u043c\u0435\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">javac<\/code>).<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.ArrayList<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.List<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.function.Function<\/span><span style=\"color: #ABB2BF\">;<\/span>\n\n<span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">class<\/span> <span style=\"color: #E5C07B\">Main<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #7F848E\">\/\/ \u041e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441: T - \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">class<\/span> <span style=\"color: #E5C07B\">Box<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">final<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">value<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">Box<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">value<\/span><span style=\"color: #ABB2BF\">) { <\/span><span style=\"color: #C678DD\">this<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">value<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">value<\/span><span style=\"color: #ABB2BF\">; }<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">get<\/span><span style=\"color: #ABB2BF\">() { <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">value<\/span><span style=\"color: #ABB2BF\">; }<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">R<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">Box<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">R<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">map<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">Function<\/span><span style=\"color: #56B6C2\">&lt;?<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">super<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #56B6C2\">?<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">extends<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">R<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">f<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">Box<\/span><span style=\"color: #56B6C2\">&lt;&gt;<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">f<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">apply<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">value<\/span><span style=\"color: #ABB2BF\">));<\/span>\n<span style=\"color: #ABB2BF\">        }<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #7F848E\">\/\/ \u041e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434: \u0441\u0432\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &lt;T&gt; \u043f\u0435\u0440\u0435\u0434 \u0442\u0438\u043f\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">firstOrDefault<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">list<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">fallback<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">list<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">isEmpty<\/span><span style=\"color: #ABB2BF\">() <\/span><span style=\"color: #56B6C2\">?<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">fallback<\/span><span style=\"color: #ABB2BF\"> : <\/span><span style=\"color: #E06C75\">list<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">get<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">0<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #7F848E\">\/\/ \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u0435\u0440\u0445\u0443: T \u0443\u043c\u0435\u0435\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0430\u043c \u0441 \u0441\u043e\u0431\u043e\u0439<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">extends<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">Comparable<\/span><span style=\"color: #56B6C2\">&lt;?<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">super<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #56B6C2\">&gt;&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">max<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">list<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">best<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">list<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">get<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">0<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">for<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">x<\/span><span style=\"color: #ABB2BF\"> : <\/span><span style=\"color: #E06C75\">list<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">x<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">compareTo<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">best<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #D19A66\">0<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #E06C75\">best<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">x<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">        }<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">best<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">main<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">[]<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">args<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">Box<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">box<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">Box<\/span><span style=\"color: #56B6C2\">&lt;&gt;<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"generics\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">s<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">box<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">get<\/span><span style=\"color: #ABB2BF\">();                       <\/span><span style=\"color: #7F848E\">\/\/ \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">Box<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">Integer<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">len<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">box<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">map<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\">::<\/span><span style=\"color: #E06C75\">length<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">s<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\" -&gt; \"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">len<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">get<\/span><span style=\"color: #ABB2BF\">());<\/span>\n\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">empty<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">ArrayList<\/span><span style=\"color: #56B6C2\">&lt;&gt;<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">firstOrDefault<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">empty<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #98C379\">\"\u043d\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445\"<\/span><span style=\"color: #ABB2BF\">));<\/span>\n\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">max<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">of<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">3<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">17<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">5<\/span><span style=\"color: #ABB2BF\">)));<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">max<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">of<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\u0433\u0440\u0443\u0448\u0430\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #98C379\">\"\u044f\u0431\u043b\u043e\u043a\u043e\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #98C379\">\"\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\"<\/span><span style=\"color: #ABB2BF\">)));<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n<span style=\"color: #ABB2BF\">}<\/span><\/code><\/pre>\n<p>\u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0431\u0443\u0434\u0435\u0442:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\">generics -&gt; 8\n\u043d\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445\n17\n\u044f\u0431\u043b\u043e\u043a\u043e\n<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0431\u043e\u0440 \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c:<\/p>\n<ul>\n<li><strong>\u041e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<\/strong> <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Box&lt;T&gt;<\/code>: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0442\u0438\u043f \u043f\u043e\u043b\u044f, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">new Box&lt;&gt;(\"generics\")<\/code> &#8212; \u00ab\u0440\u043e\u043c\u0431\u043e\u0432\u0438\u0434\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u00bb (diamond, \u0441 Java 7): \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0442\u0438\u043f\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u0430\u043c \u0438\u0437 \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/li>\n<li><strong>\u041e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434<\/strong> <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">&lt;T&gt; T firstOrDefault(...)<\/code>: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">&lt;T&gt;<\/code> \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u043c. \u0422\u0438\u043f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432; \u044f\u0432\u043d\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0430\u043a: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Main.&lt;String&gt;firstOrDefault(empty, \"x\")<\/code>.<\/li>\n<li><strong>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435<\/strong> <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T extends Comparable&lt;? super T&gt;<\/code>: \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">max<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">compareTo<\/code>. \u0412\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0443 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code> \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b \u0433\u0440\u0430\u043d\u0438\u0446\u044b. \u0421\u0442\u0440\u043e\u043a\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0430\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0430 \u043d\u0435 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u043b\u043e\u043a\u0430\u043b\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u00ab\u044f\u0431\u043b\u043e\u043a\u043e\u00bb \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u043e\u043c. \u0413\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430: \u043d\u0430 \u043f\u0443\u0441\u0442\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">max<\/code> \u0443\u043f\u0430\u0434\u0435\u0442 \u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">IndexOutOfBoundsException<\/code> \u043d\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">list.get(0)<\/code>, \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043a\u043e\u0434\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0432\u0432\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Optional&lt;T&gt;<\/code>.<\/li>\n<\/ul>\n<p>\u0423 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">extends<\/code> \u0432 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0430\u0445 \u0441\u043c\u044b\u0441\u043b \u00ab\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0442\u0438\u043f\u043e\u043c\u00bb &#8212; \u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u0413\u0440\u0430\u043d\u0438\u0446 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">&lt;T extends Number &amp; Comparable&lt;T&gt;&gt;<\/code>, \u043a\u043b\u0430\u0441\u0441 \u0438\u0434\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u043c.<\/p>\n<h2 id=\"s4\">\u0418\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c: \u043f\u043e\u0447\u0435\u043c\u0443 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Integer&gt;<\/code> &#8212; \u043d\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Number&gt;<\/code><\/h2>\n<p><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Integer<\/code> &#8212; \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Number<\/code>, \u043d\u043e <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Integer&gt;<\/code> \u043d\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Number&gt;<\/code>. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b <strong>\u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u044b<\/strong>. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\">Main.java:11: error: incompatible types: List&lt;Integer&gt; cannot be converted to List&lt;Number&gt;\n        List&lt;Number&gt; nums = ints;\n                            ^\n<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f: \u0435\u0441\u043b\u0438 \u0431\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0448\u043b\u043e, \u0447\u0435\u0440\u0435\u0437 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">nums.add(3.14)<\/code> \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0446\u0435\u043b\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Double<\/code>. \u041c\u0430\u0441\u0441\u0438\u0432\u044b \u0432 Java, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u044b (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Object[] arr = new String[1]<\/code> \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f), \u0438 \u0442\u0430 \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u0430\u043a <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">ArrayStoreException<\/code>. \u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u044d\u0442\u0443 \u0434\u044b\u0440\u0443 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/p>\n<h2 id=\"s5\">Wildcard: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">? extends<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">? super<\/code> \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e PECS<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Integer&gt;<\/code>, \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Double&gt;<\/code>, \u043d\u0443\u0436\u0435\u043d wildcard. \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0438\u0442\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u0438\u0448\u0435\u0442 \u0432 \u043d\u0435\u0435.<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.ArrayList<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.List<\/span><span style=\"color: #ABB2BF\">;<\/span>\n\n<span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">class<\/span> <span style=\"color: #E5C07B\">Main<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #7F848E\">\/\/ ? extends: \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u043c (\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c)<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">double<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">sum<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;?<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">extends<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">Number<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">nums<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E5C07B\">double<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">total<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #D19A66\">0<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">for<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">Number<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">n<\/span><span style=\"color: #ABB2BF\"> : <\/span><span style=\"color: #E06C75\">nums<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #E06C75\">total<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">n<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">doubleValue<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">total<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #7F848E\">\/\/ ? super: \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0434\u0435\u043c (\u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c)<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">fillWithOnes<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;?<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">super<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">Integer<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">target<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E5C07B\">int<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">count<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">for<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E5C07B\">int<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">i<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #D19A66\">0<\/span><span style=\"color: #ABB2BF\">; <\/span><span style=\"color: #E06C75\">i<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">count<\/span><span style=\"color: #ABB2BF\">; <\/span><span style=\"color: #E06C75\">i<\/span><span style=\"color: #56B6C2\">++<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #E06C75\">target<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">add<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">1<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">main<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">[]<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">args<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">Integer<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">ints<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">of<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">1<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">2<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">3<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">Double<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">doubles<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">of<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">0.5<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">1.5<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">sum<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">ints<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\" \"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">sum<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">doubles<\/span><span style=\"color: #ABB2BF\">));<\/span>\n\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">Number<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">numbers<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">ArrayList<\/span><span style=\"color: #56B6C2\">&lt;&gt;<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">Object<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">objects<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">ArrayList<\/span><span style=\"color: #56B6C2\">&lt;&gt;<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">fillWithOnes<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">numbers<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">2<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">fillWithOnes<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">objects<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">3<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">numbers<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\" \"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">objects<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n<span style=\"color: #ABB2BF\">}<\/span><\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">6.0 2.0<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">[1, 1] [1, 1, 1]<\/code>. \u0410 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;? extends Number&gt;<\/code> \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0438\u043f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d (\u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Double&gt;<\/code>):<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\">Main.java:6: error: incompatible types: int cannot be converted to CAP#1\n        nums.add(1);\n                 ^\n  where CAP#1 is a fresh type-variable:\n    CAP#1 extends Number from capture of ? extends Number\n<\/code><\/pre>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u043e <strong>PECS<\/strong> (Producer Extends, Consumer Super, \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0430 \u0414\u0436\u043e\u0448\u0443\u0430 \u0411\u043b\u043e\u0445\u0430 \u0438\u0437 Effective Java) \u0441\u0432\u043e\u0434\u0438\u0442 \u0432\u044b\u0431\u043e\u0440 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435:<\/p>\n<table>\n<thead>\n<tr>\n<th>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 \u0441 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0435\u0439<\/th>\n<th>Wildcard<\/th>\n<th>\u041c\u043e\u0436\u043d\u043e<\/th>\n<th>\u041d\u0435\u043b\u044c\u0437\u044f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u0422\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u0442 (\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f &#8212; \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c)<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">? extends T<\/code><\/td>\n<td>\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u043a <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code><\/td>\n<td>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c (\u043a\u0440\u043e\u043c\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">null<\/code>)<\/td>\n<\/tr>\n<tr>\n<td>\u0422\u043e\u043b\u044c\u043a\u043e \u043f\u0438\u0448\u0435\u0442 (\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f &#8212; \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c)<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">? super T<\/code><\/td>\n<td>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code><\/td>\n<td>\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u043a <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code> (\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Object<\/code>)<\/td>\n<\/tr>\n<tr>\n<td>\u0418 \u0447\u0438\u0442\u0430\u0435\u0442, \u0438 \u043f\u0438\u0448\u0435\u0442<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code> \u0431\u0435\u0437 wildcard<\/td>\n<td>\u0432\u0441\u0435<\/td>\n<td>&#8212;<\/td>\n<\/tr>\n<tr>\n<td>\u0422\u0438\u043f \u043d\u0435 \u0432\u0430\u0436\u0435\u043d (\u0440\u0430\u0437\u043c\u0435\u0440, \u043e\u0447\u0438\u0441\u0442\u043a\u0430)<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">?<\/code><\/td>\n<td>\u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 \u0442\u0438\u043f\u0430<\/td>\n<td>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0416\u0438\u0432\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 JDK: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Collections.copy(List&lt;? super T&gt; dest, List&lt;? extends T&gt; src)<\/code> &#8212; \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442, \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u0442.<\/p>\n<h2 id=\"s6\">\u0421\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0438 \u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f<\/h2>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0442\u0438\u043f\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0442\u0438\u0440\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code> \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Object<\/code> \u0438\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Comparable<\/code>), \u0432 \u043c\u0435\u0441\u0442\u0430\u0445 \u0447\u0442\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f. \u0422\u0430\u043a \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u043a\u043e\u0434\u043e\u043c \u0434\u043e Java 5. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432 Java 25:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">a<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">ArrayList<\/span><span style=\"color: #56B6C2\">&lt;&gt;<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">Integer<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">b<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">ArrayList<\/span><span style=\"color: #56B6C2\">&lt;&gt;<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">a<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getClass<\/span><span style=\"color: #ABB2BF\">() <\/span><span style=\"color: #56B6C2\">==<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">b<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getClass<\/span><span style=\"color: #ABB2BF\">()); <\/span><span style=\"color: #7F848E\">\/\/ true<\/span>\n<span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">a<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getClass<\/span><span style=\"color: #ABB2BF\">().<\/span><span style=\"color: #E06C75\">getName<\/span><span style=\"color: #ABB2BF\">());       <\/span><span style=\"color: #7F848E\">\/\/ java.util.ArrayList<\/span><\/code><\/pre>\n<p>\u0427\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 (\u043e\u0448\u0438\u0431\u043a\u0438 javac 25 \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u0430):<\/p>\n<table>\n<thead>\n<tr>\n<th>\u0427\u0442\u043e \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c<\/th>\n<th>\u041e\u0448\u0438\u0431\u043a\u0430 javac<\/th>\n<th>\u041a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">new T()<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">unexpected type ... found: type parameter T<\/code><\/td>\n<td>\u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u0430\u0431\u0440\u0438\u043a\u0443 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Supplier&lt;T&gt;<\/code> \u0438\u043b\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Class&lt;T&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">new T[n]<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">generic array creation<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;T&gt;<\/code> \u0438\u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Class&lt;T&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">o instanceof List&lt;String&gt;<\/code> (o &#8212; <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Object<\/code>)<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Object cannot be safely cast to List&lt;String&gt;<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">o instanceof List&lt;?&gt;<\/code>, \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e<\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;int&gt;<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">unexpected type ... required: reference found: int<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Integer&gt;<\/code> (\u0430\u0432\u0442\u043e\u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0430)<\/td>\n<\/tr>\n<tr>\n<td>\u0434\u0432\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">print(List&lt;String&gt;)<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">print(List&lt;Integer&gt;)<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">name clash: ... have the same erasure<\/code><\/td>\n<td>\u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u041e\u0431\u0445\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0431\u0440\u0438\u043a\u0443, \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u043c:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">fill<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">Supplier<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">factory<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E5C07B\">int<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">n<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">T<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">ArrayList<\/span><span style=\"color: #56B6C2\">&lt;&gt;<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">for<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E5C07B\">int<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">i<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #D19A66\">0<\/span><span style=\"color: #ABB2BF\">; <\/span><span style=\"color: #E06C75\">i<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">n<\/span><span style=\"color: #ABB2BF\">; <\/span><span style=\"color: #E06C75\">i<\/span><span style=\"color: #56B6C2\">++<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">add<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">factory<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">get<\/span><span style=\"color: #ABB2BF\">());<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">}<\/span>\n<span style=\"color: #7F848E\">\/\/ fill(StringBuilder::new, 2).size() -&gt; 2<\/span><\/code><\/pre>\n<h2 id=\"s7\">Raw types \u0438 \u0437\u0430\u0433\u0440\u044f\u0437\u043d\u0435\u043d\u0438\u0435 \u043a\u0443\u0447\u0438<\/h2>\n<p>Raw type (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List<\/code> \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430) \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0440\u0430\u0434\u0438 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0421\u043c\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u044b\u0440\u043e\u0433\u043e \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u0434\u0430\u0435\u0442 <strong>\u0437\u0430\u0433\u0440\u044f\u0437\u043d\u0435\u043d\u0438\u0435 \u043a\u0443\u0447\u0438<\/strong> (heap pollution): \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;String&gt;<\/code> \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Integer<\/code>, \u0430 \u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0435 \u0432 \u043c\u0435\u0441\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0430 \u043f\u043e\u0437\u0436\u0435, \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438.<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">a<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">ArrayList<\/span><span style=\"color: #56B6C2\">&lt;&gt;<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #E06C75\">List<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">raw<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">a<\/span><span style=\"color: #ABB2BF\">;                <\/span><span style=\"color: #7F848E\">\/\/ warning: [rawtypes]<\/span>\n<span style=\"color: #E06C75\">raw<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">add<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">42<\/span><span style=\"color: #ABB2BF\">);                 <\/span><span style=\"color: #7F848E\">\/\/ warning: [unchecked], \u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/span>\n<span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">a<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">size<\/span><span style=\"color: #ABB2BF\">()); <\/span><span style=\"color: #7F848E\">\/\/ 1<\/span>\n<span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">first<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">a<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">get<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">0<\/span><span style=\"color: #ABB2BF\">);     <\/span><span style=\"color: #7F848E\">\/\/ ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String<\/span><\/code><\/pre>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e: \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c raw types \u0432 \u043d\u043e\u0432\u043e\u043c \u043a\u043e\u0434\u0435, \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">-Xlint:unchecked,rawtypes<\/code> \u0438 \u043d\u0435 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">@SuppressWarnings(\"unchecked\")<\/code>, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e.<\/p>\n<h2 id=\"s8\">\u0421\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043e\u0431 \u0438\u043c\u0435\u043d\u0430\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/h2>\n<p>\u0418\u043c\u0435\u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0438\u043f\u0430 \u043f\u043e \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e &#8212; \u043e\u0434\u043d\u0430 \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0431\u0443\u043a\u0432\u0430, \u0447\u0442\u043e\u0431\u044b \u0438\u0445 \u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432:<\/p>\n<table>\n<thead>\n<tr>\n<th>\u0411\u0443\u043a\u0432\u0430<\/th>\n<th>\u0421\u043c\u044b\u0441\u043b<\/th>\n<th>\u0413\u0434\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code><\/td>\n<td>Type, \u0442\u0438\u043f<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Box&lt;T&gt;<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Optional&lt;T&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">E<\/code><\/td>\n<td>Element, \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;E&gt;<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Set&lt;E&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">K<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">V<\/code><\/td>\n<td>Key, Value<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Map&lt;K, V&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">N<\/code><\/td>\n<td>Number<\/td>\n<td>\u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b<\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">R<\/code><\/td>\n<td>Result<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Function&lt;T, R&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">S<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">U<\/code><\/td>\n<td>\u0432\u0442\u043e\u0440\u043e\u0439, \u0442\u0440\u0435\u0442\u0438\u0439 \u0442\u0438\u043f<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">BiFunction&lt;T, U, R&gt;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u042d\u0442\u043e \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435, \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u044f\u0437\u044b\u043a\u0430: \u0438\u043c\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">&lt;Item&gt;<\/code> \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043c\u0435\u0442 \u0435\u0433\u043e \u0437\u0430 \u043a\u043b\u0430\u0441\u0441.<\/p>\n<h2 id=\"s9\">\u0415\u0441\u043b\u0438 \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f: \u0441\u0438\u043c\u043f\u0442\u043e\u043c -&gt; \u043f\u0440\u0438\u0447\u0438\u043d\u0430<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u0421\u0438\u043c\u043f\u0442\u043e\u043c<\/th>\n<th>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430<\/th>\n<th>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Integer&gt; cannot be converted to List&lt;Number&gt;<\/code><\/td>\n<td>\u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c<\/td>\n<td>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u0435\u0442\u043e\u0434\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;? extends Number&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">cannot be converted to CAP#1<\/code><\/td>\n<td>\u0437\u0430\u043f\u0438\u0441\u044c \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">? extends<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">? super T<\/code> \u0438\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Note: ... uses unchecked or unsafe operations<\/code><\/td>\n<td>raw type \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/td>\n<td>\u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">-Xlint:unchecked<\/code> \u0438 \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443<\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">ClassCastException<\/code> \u0442\u0430\u043c, \u0433\u0434\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u043d\u0435 \u0432\u0438\u0434\u043d\u043e<\/td>\n<td>heap pollution \u0447\u0435\u0440\u0435\u0437 raw type<\/td>\n<td>\u0438\u0441\u043a\u0430\u0442\u044c raw types \u0432\u044b\u0448\u0435 \u043f\u043e \u043f\u043e\u0442\u043e\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445<\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">generic array creation<\/code><\/td>\n<td>\u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;T&gt;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"s10\">\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<ul>\n<li>\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 &#8212; \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0438\u043f\u043e\u0432: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Box&lt;T&gt;<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;String&gt;<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">&lt;T&gt; T method(...)<\/code>. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u043e\u043b\u044c\u0437\u0430 &#8212; \u043e\u0448\u0438\u0431\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u043b\u043e\u0432\u0438\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043d\u0435 \u043d\u0443\u0436\u043d\u044b.<\/li>\n<li>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u044b: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Integer&gt;<\/code> \u043d\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;Number&gt;<\/code>. \u0413\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0434\u0430\u044e\u0442 wildcard <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">? extends<\/code> (\u0447\u0442\u0435\u043d\u0438\u0435) \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">? super<\/code> (\u0437\u0430\u043f\u0438\u0441\u044c) \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0443 PECS.<\/li>\n<li>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T extends X<\/code> \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">X<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430; \u0433\u0440\u0430\u043d\u0438\u0446 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e.<\/li>\n<li>\u0418\u0437-\u0437\u0430 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u043d\u0435\u043b\u044c\u0437\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">new T()<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">new T[]<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">instanceof List&lt;String&gt;<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;int&gt;<\/code> \u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443 \u0442\u0438\u043f\u0430.<\/li>\n<li>Raw types \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0432\u0435\u0434\u0443\u0442 \u043a heap pollution; \u0432 \u043d\u043e\u0432\u043e\u043c \u043a\u043e\u0434\u0435 &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">-Xlint<\/code>.<\/li>\n<\/ul>\n<h2 id=\"s11\">\u0413\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \/ \u0441\u0432\u044f\u0437\u044c \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439<\/h2>\n<p>\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 &#8212; \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430: \u043d\u0430 \u043d\u0438\u0445 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Optional<\/code>, Stream API, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Spring Data \u0438 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 DTO. \u041d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043f\u0440\u043e PECS \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u0435\u0437 \u043d\u0438\u0445 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b JDK. \u041a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0441\u0430\u043c\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"\/journal\/vse-o-kollekciyah-v-dzhave\/\">\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f\u0445 \u0432 Java<\/a>.<\/p>\n<div class=\"oj-cta\" style=\"background:#fbf4e4;border-left:4px solid #c9962b;border-radius:8px;padding:16px 20px;margin:24px 0\">\n<p style=\"margin:0 0 8px\"><strong>\u041e\u0441\u0432\u043e\u0439\u0442\u0435 \u0442\u0435\u043c\u0443 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, Stream API \u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043a\u0443\u0440\u0441 <a href=\"https:\/\/otus.ru\/lessons\/java-professional\/?int_article=poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah&amp;int_place=article&amp;int_variant=v1\">\u00abJava \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c\u00bb<\/a>. \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0442\u0435\u043c\u0443 \u0441 \u043f\u0440\u0435\u043f\u043e\u0434\u0430\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430 <a href=\"https:\/\/otus.ru\/events\/?int_article=poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah&amp;int_place=article&amp;int_variant=v1\">\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0443\u0440\u043e\u043a\u0430\u0445 Otus<\/a>.<\/p>\n<\/div>\n<h2 id=\"s12\">FAQ<\/h2>\n<p><strong>\u0427\u0435\u043c \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 Java \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 C++?<\/strong><br \/>\n\u0428\u0430\u0431\u043b\u043e\u043d C++ \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0442\u0438\u043f\u0430, \u0430 \u0432 Java \u043e\u0434\u0438\u043d \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u0441\u043b\u0435 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u044f \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 Java \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u043c \u0438 \u0443\u0437\u043d\u0430\u0442\u044c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code> \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0443\u0437\u043d\u0430\u0442\u044c \u0442\u0438\u043f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">T<\/code> \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f?<\/strong><br \/>\n\u041d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0435\u0442. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Class&lt;T&gt;<\/code> \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440; \u0442\u0438\u043f \u0438\u0437 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">class Repo extends Base&lt;User&gt;<\/code>) \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044e <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">getGenericSuperclass()<\/code>.<\/p>\n<p><strong>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;?&gt;<\/code> \u0438 \u0447\u0435\u043c \u043e\u043d \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 raw <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List<\/code>?<\/strong><br \/>\n<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List&lt;?&gt;<\/code> &#8212; \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e, \u043d\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430: \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0434\u0430\u0441\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043a\u0440\u043e\u043c\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">null<\/code>. Raw <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">List<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e.<\/p>\n<p><strong>\u0415\u0441\u0442\u044c \u043b\u0438 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0443 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043b\u0435\u0439?<\/strong><br \/>\n\u041d\u0435\u0442: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0443, \u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u043b\u0435 \u043e\u0431\u0449\u0435\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">static T value<\/code> \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0423 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u0432\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">static &lt;T&gt; ...<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 (generics) \u0432 Java &#8212; \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u043e\u0432: \u043a\u043b\u0430\u0441\u0441, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0442\u0438\u043f\u0430 (&lt;T&gt;), \u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f (String, Integer) \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438. \u041d\u0443\u0436\u043d\u044b \u043e\u043d\u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0448\u0438\u0431\u043a\u0443 \u00ab\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043d\u0435 \u0442\u043e\u0442 \u0442\u0438\u043f\u00bb \u043b\u043e\u0432\u0438\u043b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0430 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0438 \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0434 \u043d\u0435 \u0431\u044b\u043b \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0440\u0443\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f\u043c\u0438 [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":2499,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[75],"class_list":["post-2498","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-polza","tag-java"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 generic \u0432 Java \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 T, \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, extends, wildcard \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e PECS, \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0438 raw types. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b \u043d\u0430 Java 25.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"A. Pavlenko\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#article\",\"name\":\"\\u0414\\u0436\\u0435\\u043d\\u0435\\u0440\\u0438\\u043a\\u0438 (generics) \\u0432 Java: \\u0447\\u0442\\u043e \\u044d\\u0442\\u043e \\u0438 \\u0437\\u0430\\u0447\\u0435\\u043c | Otus\",\"headline\":\"\\u0414\\u0436\\u0435\\u043d\\u0435\\u0440\\u0438\\u043a\\u0438 \\u0432 Java: \\u0447\\u0442\\u043e \\u044d\\u0442\\u043e \\u0442\\u0430\\u043a\\u043e\\u0435 \\u0438 \\u0434\\u043b\\u044f \\u0447\\u0435\\u0433\\u043e \\u043e\\u043d\\u0438 \\u043d\\u0443\\u0436\\u043d\\u044b\",\"author\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/oj-1080x720-17.png\",\"width\":1080,\"height\":720},\"datePublished\":\"2026-09-24T09:00:00+00:00\",\"dateModified\":\"2026-09-25T15:30:37+00:00\",\"inLanguage\":\"ru-RU\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#webpage\"},\"articleSection\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435, Java\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/otus.ru\\\/journal\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/#listItem\",\"name\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/#listItem\",\"position\":2,\"name\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435\",\"item\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#listItem\",\"name\":\"\\u0414\\u0436\\u0435\\u043d\\u0435\\u0440\\u0438\\u043a\\u0438 \\u0432 Java: \\u0447\\u0442\\u043e \\u044d\\u0442\\u043e \\u0442\\u0430\\u043a\\u043e\\u0435 \\u0438 \\u0434\\u043b\\u044f \\u0447\\u0435\\u0433\\u043e \\u043e\\u043d\\u0438 \\u043d\\u0443\\u0436\\u043d\\u044b\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#listItem\",\"position\":3,\"name\":\"\\u0414\\u0436\\u0435\\u043d\\u0435\\u0440\\u0438\\u043a\\u0438 \\u0432 Java: \\u0447\\u0442\\u043e \\u044d\\u0442\\u043e \\u0442\\u0430\\u043a\\u043e\\u0435 \\u0438 \\u0434\\u043b\\u044f \\u0447\\u0435\\u0433\\u043e \\u043e\\u043d\\u0438 \\u043d\\u0443\\u0436\\u043d\\u044b\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/#listItem\",\"name\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#organization\",\"name\":\"\\u041e\\u0442\\u0443\\u0441 \\u043e\\u043d\\u043b\\u0430\\u0439\\u043d-\\u043e\\u0431\\u0440\\u0430\\u0437\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435\",\"description\":\"\\u0411\\u043b\\u043e\\u0433 \\u043f\\u0440\\u043e IT\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/\",\"telephone\":\"+74999389202\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/OTUS-journal-logo-180x180-1.png\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#organizationLogo\",\"width\":180,\"height\":180},\"image\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCetgtvy93o3i3CvyGXKFU3g\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/\",\"name\":\"A. Pavlenko\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/13488c7d5b657aaaf1808afd398f71e0225df07dd94eb7e5fcdfc45feff43cb5?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"A. Pavlenko\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#webpage\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/\",\"name\":\"\\u0414\\u0436\\u0435\\u043d\\u0435\\u0440\\u0438\\u043a\\u0438 (generics) \\u0432 Java: \\u0447\\u0442\\u043e \\u044d\\u0442\\u043e \\u0438 \\u0437\\u0430\\u0447\\u0435\\u043c | Otus\",\"description\":\"\\u0427\\u0442\\u043e \\u0442\\u0430\\u043a\\u043e\\u0435 generic \\u0432 Java \\u0438 \\u0434\\u043b\\u044f \\u0447\\u0435\\u0433\\u043e \\u043e\\u043d \\u043d\\u0443\\u0436\\u0435\\u043d: \\u043f\\u0430\\u0440\\u0430\\u043c\\u0435\\u0442\\u0440 T, \\u043e\\u0431\\u043e\\u0431\\u0449\\u0435\\u043d\\u043d\\u044b\\u0435 \\u043c\\u0435\\u0442\\u043e\\u0434\\u044b, extends, wildcard \\u0438 \\u043f\\u0440\\u0430\\u0432\\u0438\\u043b\\u043e PECS, \\u0441\\u0442\\u0438\\u0440\\u0430\\u043d\\u0438\\u0435 \\u0442\\u0438\\u043f\\u043e\\u0432 \\u0438 raw types. \\u041f\\u0440\\u0438\\u043c\\u0435\\u0440\\u044b \\u043f\\u0440\\u043e\\u0432\\u0435\\u0440\\u0435\\u043d\\u044b \\u043d\\u0430 Java 25.\",\"inLanguage\":\"ru-RU\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/oj-1080x720-17.png\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#mainImage\",\"width\":1080,\"height\":720},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\\\/#mainImage\"},\"datePublished\":\"2026-09-24T09:00:00+00:00\",\"dateModified\":\"2026-09-25T15:30:37+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#website\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/\",\"name\":\"OTUS \\u0416\\u0443\\u0440\\u043d\\u0430\\u043b - \\u0411\\u043b\\u043e\\u0433 \\u043f\\u0440\\u043e IT\",\"alternateName\":\"OTUS \\u0416\\u0443\\u0440\\u043d\\u0430\\u043b\",\"description\":\"\\u0411\\u043b\\u043e\\u0433 \\u043f\\u0440\\u043e IT\",\"inLanguage\":\"ru-RU\",\"publisher\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 (generics) \u0432 Java: \u0447\u0442\u043e \u044d\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c | Otus","description":"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 generic \u0432 Java \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 T, \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, extends, wildcard \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e PECS, \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0438 raw types. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b \u043d\u0430 Java 25.","canonical_url":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#article","name":"\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 (generics) \u0432 Java: \u0447\u0442\u043e \u044d\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c | Otus","headline":"\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0432 Java: \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b","author":{"@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author"},"publisher":{"@id":"https:\/\/otus.ru\/journal\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/otus.ru\/journal\/wp-content\/uploads\/2021\/11\/oj-1080x720-17.png","width":1080,"height":720},"datePublished":"2026-09-24T09:00:00+00:00","dateModified":"2026-09-25T15:30:37+00:00","inLanguage":"ru-RU","mainEntityOfPage":{"@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#webpage"},"isPartOf":{"@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#webpage"},"articleSection":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435, Java"},{"@type":"BreadcrumbList","@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/#listItem","position":1,"name":"Home","item":"https:\/\/otus.ru\/journal\/","nextItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/category\/polza\/#listItem","name":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435"}},{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/category\/polza\/#listItem","position":2,"name":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435","item":"https:\/\/otus.ru\/journal\/category\/polza\/","nextItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#listItem","name":"\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0432 Java: \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b"},"previousItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#listItem","position":3,"name":"\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0432 Java: \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b","previousItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/category\/polza\/#listItem","name":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435"}}]},{"@type":"Organization","@id":"https:\/\/otus.ru\/journal\/#organization","name":"\u041e\u0442\u0443\u0441 \u043e\u043d\u043b\u0430\u0439\u043d-\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435","description":"\u0411\u043b\u043e\u0433 \u043f\u0440\u043e IT","url":"https:\/\/otus.ru\/journal\/","telephone":"+74999389202","logo":{"@type":"ImageObject","url":"https:\/\/otus.ru\/journal\/wp-content\/uploads\/2026\/04\/OTUS-journal-logo-180x180-1.png","@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#organizationLogo","width":180,"height":180},"image":{"@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#organizationLogo"},"sameAs":["https:\/\/www.youtube.com\/channel\/UCetgtvy93o3i3CvyGXKFU3g"]},{"@type":"Person","@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author","url":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/","name":"A. Pavlenko","image":{"@type":"ImageObject","@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/13488c7d5b657aaaf1808afd398f71e0225df07dd94eb7e5fcdfc45feff43cb5?s=96&d=mm&r=g","width":96,"height":96,"caption":"A. Pavlenko"}},{"@type":"WebPage","@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#webpage","url":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/","name":"\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 (generics) \u0432 Java: \u0447\u0442\u043e \u044d\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c | Otus","description":"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 generic \u0432 Java \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 T, \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, extends, wildcard \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e PECS, \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0438 raw types. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b \u043d\u0430 Java 25.","inLanguage":"ru-RU","isPartOf":{"@id":"https:\/\/otus.ru\/journal\/#website"},"breadcrumb":{"@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#breadcrumblist"},"author":{"@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author"},"creator":{"@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/otus.ru\/journal\/wp-content\/uploads\/2021\/11\/oj-1080x720-17.png","@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#mainImage","width":1080,"height":720},"primaryImageOfPage":{"@id":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/#mainImage"},"datePublished":"2026-09-24T09:00:00+00:00","dateModified":"2026-09-25T15:30:37+00:00"},{"@type":"WebSite","@id":"https:\/\/otus.ru\/journal\/#website","url":"https:\/\/otus.ru\/journal\/","name":"OTUS \u0416\u0443\u0440\u043d\u0430\u043b - \u0411\u043b\u043e\u0433 \u043f\u0440\u043e IT","alternateName":"OTUS \u0416\u0443\u0440\u043d\u0430\u043b","description":"\u0411\u043b\u043e\u0433 \u043f\u0440\u043e IT","inLanguage":"ru-RU","publisher":{"@id":"https:\/\/otus.ru\/journal\/#organization"}}]}},"aioseo_meta_data":{"post_id":"2498","title":"\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 (generics) \u0432 Java: \u0447\u0442\u043e \u044d\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c | Otus","description":"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 generic \u0432 Java \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 T, \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, extends, wildcard \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e PECS, \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0438 raw types. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b \u043d\u0430 Java 25.","keywords":[],"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"none","schema_type_options":"{\"webPage\":{\"webPageType\":\"WebPage\"},\"article\":{\"articleType\":\"BlogPosting\"},\"book\":[],\"course\":[],\"event\":[],\"jobPosting\":[],\"music\":[],\"person\":[],\"product\":[],\"recipe\":[],\"restaurant\":[],\"service\":[],\"software\":[],\"video\":[]}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":{"businessInfo":{"name":"","urls":{"website":"","aboutPage":"","contactPage":""},"address":{"line1":"","line2":"","zip":"","city":"","state":"","country":""},"contact":{"email":"","phone":"","fax":""},"ids":{"vatID":"","taxID":"","chamberID":""},"payment":{"priceIndication":"","currenciesAccepted":"","methodsAccepted":""},"areaServed":""},"openingHours":{"show":false,"closedLabel":"","open24h":false,"open24hLabel":"","open247":false,"use24hFormat":false,"twoSets":false,"timezone":"","hours":[]}},"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-11-30 16:07:07","updated":"2026-09-25 17:40:02","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/otus.ru\/journal\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/otus.ru\/journal\/category\/polza\/\" title=\"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435\">\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0432 Java: \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/otus.ru\/journal\/"},{"label":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435","link":"https:\/\/otus.ru\/journal\/category\/polza\/"},{"label":"\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0432 Java: \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b","link":"https:\/\/otus.ru\/journal\/poleznosti-java-chto-dolzhen-znat-programmist-o-dzhenerikah\/"}],"_links":{"self":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts\/2498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/comments?post=2498"}],"version-history":[{"count":3,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts\/2498\/revisions"}],"predecessor-version":[{"id":12974,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts\/2498\/revisions\/12974"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/media\/2499"}],"wp:attachment":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/media?parent=2498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/categories?post=2498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/tags?post=2498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}