{"id":67235,"date":"2024-11-05T18:49:48","date_gmt":"2024-11-05T15:49:48","guid":{"rendered":"https:\/\/foxminded.ua\/?p=67235"},"modified":"2024-11-05T18:49:49","modified_gmt":"2024-11-05T15:49:49","slug":"ogranicheniya-generics-i-stiranie-tipov","status":"publish","type":"post","link":"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/","title":{"rendered":"\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f generics \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Generic \u043a\u043b\u0430\u0441\u0441\u0430\u0445"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043c\u043e\u0449\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432 <a href=\"https:\/\/foxminded.ua\/ru\/strong-junior-java\/\">Java<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 generics \u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n\n\n    <div class=\"adv_block\">\r\n        <div class=\"top_text\">\u0425\u043e\u0442\u0438\u0442\u0435 \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044e Java Developer? \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 <a href=\"https:\/\/foxminded.ua\/ru\/strong-junior-java\/\">&#171;\u041e\u0442 0 \u0434\u043e Strong Java Junior \u0437\u0430 12 \u043c\u0435\u0441\u044f\u0446\u0435\u0432&#187;<\/a>. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0432\u044b\u0433\u043e\u0434\u043d\u044b\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043e\u0442 FoxmindEd!<\/div>\r\n        \r\n        <a href=\"https:\/\/foxminded.ua\/ru\/strong-junior-java\/\" class=\"adv_block_btn btn btn-primary\">\r\n            \u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f        <\/a>\r\n    <\/div>\r\n\n\n\n<h2 class=\"wp-block-heading\">\u0421\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Generics \u0431\u044b\u043b\u0438 \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Java 5, \u0438 \u0432\u0441\u0442\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0441 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0430\u043c\u0438 \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0443 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0434\u043e \u0438\u0445 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f. \u0411\u044b\u043b\u043e \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435, \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438, Raw Type &#8212; \u044d\u0442\u043e \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a-\u043a\u043b\u0430\u0441\u0441, \u0433\u0434\u0435 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"List list = new ArrayList();\" style=\"color:#002339;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki slack-ochin\" style=\"background-color: #FFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #2F86D2\">List<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">list<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">=<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">new<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7EB233\">ArrayList<\/span><span style=\"color: #002339\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 Object. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u043e\u0432, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 Java-\u043a\u043e\u0434 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u043e\u0439. \u0415\u0441\u043b\u0438 \u0431\u044b \u0431\u0430\u0439\u0442-\u043a\u043e\u0434 \u0445\u0440\u0430\u043d\u0438\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0442\u0438\u043f\u043e\u0432, \u044d\u0442\u043e \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043e Java 5, \u0433\u0434\u0435 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u0432 \u0435\u0449\u0435 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043d\u0435 \u0432\u043b\u0438\u044f\u043b\u0438 \u043d\u0430 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f &#171;\u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435\u043c \u0442\u0438\u043f\u043e\u0432&#187; (type erasure), \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0438\u043f\u0430\u0445-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0441\u0442\u0438\u0440\u0430\u0435\u0442\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0438, \u043a\u0430\u043a:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"List&lt;String&gt; stringList = new ArrayList&lt;&gt;();\n\nList&lt;Bag&gt; bagList = new ArrayList&lt;&gt;();\" style=\"color:#002339;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki slack-ochin\" style=\"background-color: #FFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #2F86D2\">List<\/span><span style=\"color: #7B30D0\">&lt;<\/span><span style=\"color: #2F86D2\">String<\/span><span style=\"color: #7B30D0\">&gt;<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">stringList<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">=<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">new<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">ArrayList<\/span><span style=\"color: #7B30D0\">&lt;&gt;<\/span><span style=\"color: #002339\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #2F86D2\">List<\/span><span style=\"color: #7B30D0\">&lt;<\/span><span style=\"color: #2F86D2\">Bag<\/span><span style=\"color: #7B30D0\">&gt;<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">bagList<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">=<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">new<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">ArrayList<\/span><span style=\"color: #7B30D0\">&lt;&gt;<\/span><span style=\"color: #002339\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0430 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0439:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"List&lt;Object&gt;\" style=\"color:#002339;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki slack-ochin\" style=\"background-color: #FFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #2F86D2\">List<\/span><span style=\"color: #7B30D0\">&lt;<\/span><span style=\"color: #2F86D2\">Object<\/span><span style=\"color: #7B30D0\">&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u044b\u043b \u0434\u043b\u044f String, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 &#8212; \u0434\u043b\u044f Bag. \u0414\u043b\u044f JVM \u044d\u0442\u0438 \u0441\u043f\u0438\u0441\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043f\u0438\u0441\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 (List&lt;Object&gt;).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 generics. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f generics<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Generics \u0432 Java \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u043e\u0432, \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0442\u043e\u0438\u0442 \u0437\u043d\u0430\u0442\u044c \u043f\u0440\u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438. \u0412\u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f generics \u0432 Java:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u041e\u0432\u0435\u0440\u043b\u043e\u0434\u0438\u043d\u0433 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Generics \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 (overloading) \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0438\u043f\u043e\u0432. \u0415\u0441\u043b\u0438 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443, \u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0438\u043f\u043e\u0432, \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043d\u044b\u043c\u0438 \u0438\u0437-\u0437\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"public class Test {\n\n\u00a0\u00a0\u00a0public void print(List&lt;String&gt; list) {}\n\n\u00a0\u00a0\u00a0public void print(List&lt;Integer&gt; list) {} \/\/ \u042d\u0442\u043e \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437-\u0437\u0430 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u043b\u044f JVM \u044d\u0442\u0438 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 List&lt;Object&gt;\n\n}\" style=\"color:#002339;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki slack-ochin\" style=\"background-color: #FFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #2F86D2\">public<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0991B6\">class<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0444AC\">Test<\/span><span style=\"color: #002339\"> {<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">\u00a0\u00a0\u00a0<\/span><span style=\"color: #DA5221\">public<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">void<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7EB233\">print<\/span><span style=\"color: #002339\">(<\/span><span style=\"color: #B1108E\">List<\/span><span style=\"color: #002339\">&lt;<\/span><span style=\"color: #B1108E\">String<\/span><span style=\"color: #002339\">&gt; <\/span><span style=\"color: #B1108E\">list<\/span><span style=\"color: #002339\">) {}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">\u00a0\u00a0\u00a0<\/span><span style=\"color: #DA5221\">public<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">void<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7EB233\">print<\/span><span style=\"color: #002339\">(<\/span><span style=\"color: #B1108E\">List<\/span><span style=\"color: #002339\">&lt;<\/span><span style=\"color: #B1108E\">Integer<\/span><span style=\"color: #002339\">&gt; <\/span><span style=\"color: #B1108E\">list<\/span><span style=\"color: #002339\">) {} <\/span><span style=\"color: #357B42; font-style: italic\">\/\/ \u042d\u0442\u043e \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437-\u0437\u0430 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u043b\u044f JVM \u044d\u0442\u0438 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 List&lt;Object&gt;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u041d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 Java generics \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0438\u043f\u0430\u0445 \u0441\u0442\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c type erasure (\u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"public class Bag&lt;T&gt; {\n\n\u00a0\u00a0\u00a0private T value;\n\n\u00a0\u00a0\u00a0public Bag() {\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0value = new T(); \/\/ \u042d\u0442\u043e \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e T - \u044d\u0442\u043e \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\n\n\u00a0\u00a0\u00a0}\n\n}\" style=\"color:#002339;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki slack-ochin\" style=\"background-color: #FFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #2F86D2\">public<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0991B6\">class<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0444AC\">Bag<\/span><span style=\"color: #002339\">&lt;<\/span><span style=\"color: #0444AC\">T<\/span><span style=\"color: #002339\">&gt; {<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">\u00a0\u00a0\u00a0<\/span><span style=\"color: #DA5221\">private<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">T<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">value<\/span><span style=\"color: #002339\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">\u00a0\u00a0\u00a0<\/span><span style=\"color: #DA5221\">public<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7EB233\">Bag<\/span><span style=\"color: #002339\">() {<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #2F86D2\">value<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">=<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">new<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7EB233\">T<\/span><span style=\"color: #002339\">(); <\/span><span style=\"color: #357B42; font-style: italic\">\/\/ \u042d\u0442\u043e \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e T - \u044d\u0442\u043e \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">\u00a0\u00a0\u00a0}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n    <div class=\"adv_courses_links\">\r\n        <div class=\"adv_courses_wrap\">\r\n            <div class=\"top_block\">\r\n                <span>FoxmindEd<\/span> &#8212; \u044d\u0442\u043e \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u0446\u0435\u043d\u0442\u0440 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043a\u0443\u0440\u0441\u043e\u0432 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u0441 \u043e\u043f\u044b\u0442\u043e\u043c!            <\/div>\r\n            <div class=\"adv_courses_link\">\r\n                <span>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0441\u0432\u043e\u0439 \u043f\u0443\u0442\u044c \u0432 I\u0422?<\/span> \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 <a href=\"https:\/\/foxminded.ua\/ru\/start-course-2\/\">\u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0435 IT-\u043a\u0443\u0440\u0441\u044b<\/a>            <\/div>\r\n            <div class=\"adv_courses_link\">\r\n                <span>\u0418\u043c\u0435\u0435\u0442\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043d\u0430\u0432\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f?<\/span> \u0422\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0430 <a href=\"https:\/\/foxminded.ua\/ru\/junior-course\/\">\u043a\u0443\u0440\u0441\u044b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u041c\u0435\u043d\u0442\u043e\u0440\u0438\u043d\u0433<\/a>            <\/div>\r\n            <div class=\"adv_courses_link\">\r\n                <span>\u0425\u043e\u0442\u0438\u0442\u0435 \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u043d\u0438\u044f \u0432 I\u0422?<\/span> \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c <a href=\"https:\/\/foxminded.ua\/ru\/advanced-courses\/\">\u043a\u0443\u0440\u0441\u044b \u0434\u043b\u044f middle\/senior<\/a>            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n\n\n\n<h3 class=\"wp-block-heading\">\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b instanceof \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0438\u043f\u0430\u0445 generics \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f, \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0442\u0438\u043f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 instanceof \u0434\u043b\u044f generics.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"public class Bag&lt;T&gt; {\n\n\u00a0\u00a0\u00a0public boolean isInstance(Object obj) {\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return obj instanceof T; \/\/ \u042d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f\n\n\u00a0\u00a0\u00a0}\n\n}\" style=\"color:#002339;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki slack-ochin\" style=\"background-color: #FFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #2F86D2\">public<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0991B6\">class<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0444AC\">Bag<\/span><span style=\"color: #002339\">&lt;<\/span><span style=\"color: #0444AC\">T<\/span><span style=\"color: #002339\">&gt; {<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">\u00a0\u00a0\u00a0<\/span><span style=\"color: #DA5221\">public<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">boolean<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7EB233\">isInstance<\/span><span style=\"color: #002339\">(<\/span><span style=\"color: #B1108E\">Object<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #B1108E\">obj<\/span><span style=\"color: #002339\">) {<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #7B30D0\">return<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">obj<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">instanceof<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0444AC\">T<\/span><span style=\"color: #002339\">; <\/span><span style=\"color: #357B42; font-style: italic\">\/\/ \u042d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">\u00a0\u00a0\u00a0}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Generics \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Generics \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a int, char, boolean \u0438 \u0442. \u0414. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043e\u0431\u0435\u0440\u0442\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Integer \u0434\u043b\u044f int, Double \u0434\u043b\u044f double \u0438 \u0442. \u0414.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"List&lt;int&gt; intList = new ArrayList&lt;&gt;(); \/\/ \u042d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f\" style=\"color:#002339;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki slack-ochin\" style=\"background-color: #FFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #2F86D2\">List<\/span><span style=\"color: #7B30D0\">&lt;<\/span><span style=\"color: #2F86D2\">int<\/span><span style=\"color: #7B30D0\">&gt;<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">intList<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">=<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">new<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">ArrayList<\/span><span style=\"color: #7B30D0\">&lt;&gt;<\/span><span style=\"color: #002339\">(); <\/span><span style=\"color: #357B42; font-style: italic\">\/\/ \u042d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0432 generics \u043d\u0430\u0440\u0443\u0448\u0438\u043b\u0438 \u0431\u044b \u043e\u0431\u0449\u0443\u044e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 Object. \u041d\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u043e\u043d\u0438 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u044b \u0432 Object.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0434\u043d\u0430\u043a\u043e generics \u0432\u0441\u0435 \u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c autoboxing\/unboxing. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 generics \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0438<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"int num = 20;\n\nList&lt;Integer&gt; numbers = new ArrayList&lt;&gt;();\n\nnumbers.add(num); \/\/ int \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 Integer\n\nint num2 = numbers.get(0); \/\/ Integer \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u00ab\u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00bb \u0432 int\" style=\"color:#002339;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki slack-ochin\" style=\"background-color: #FFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #2F86D2\">int<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">num<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">=<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #174781\">20<\/span><span style=\"color: #002339\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #2F86D2\">List<\/span><span style=\"color: #7B30D0\">&lt;<\/span><span style=\"color: #2F86D2\">Integer<\/span><span style=\"color: #7B30D0\">&gt;<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">numbers<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">=<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">new<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">ArrayList<\/span><span style=\"color: #7B30D0\">&lt;&gt;<\/span><span style=\"color: #002339\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #2F86D2\">numbers<\/span><span style=\"color: #002339\">.<\/span><span style=\"color: #7EB233\">add<\/span><span style=\"color: #002339\">(<\/span><span style=\"color: #2F86D2\">num<\/span><span style=\"color: #002339\">); <\/span><span style=\"color: #357B42; font-style: italic\">\/\/ int \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 Integer<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #2F86D2\">int<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">num2<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #7B30D0\">=<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">numbers<\/span><span style=\"color: #002339\">.<\/span><span style=\"color: #7EB233\">get<\/span><span style=\"color: #002339\">(<\/span><span style=\"color: #174781\">0<\/span><span style=\"color: #002339\">); <\/span><span style=\"color: #357B42; font-style: italic\">\/\/ Integer \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u00ab\u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00bb \u0432 int<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Generics \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u043c\u0438<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Generics \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0443 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0443.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"public class Bag&lt;T&gt; {\n\n\u00a0\u00a0\u00a0private static T value; \/\/ \u042d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f\n\n}\" style=\"color:#002339;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki slack-ochin\" style=\"background-color: #FFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #2F86D2\">public<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0991B6\">class<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0444AC\">Bag<\/span><span style=\"color: #002339\">&lt;<\/span><span style=\"color: #0444AC\">T<\/span><span style=\"color: #002339\">&gt; {<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">\u00a0\u00a0\u00a0<\/span><span style=\"color: #DA5221\">private<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #DA5221\">static<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">T<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #2F86D2\">value<\/span><span style=\"color: #002339\">; <\/span><span style=\"color: #357B42; font-style: italic\">\/\/ \u042d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c generics \u0432 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u0445<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Generics \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u0431\u044b \u043a \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"public class MyException&lt;T&gt; extends Exception { \/\/ \u042d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f\n\n}\" style=\"color:#002339;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki slack-ochin\" style=\"background-color: #FFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #2F86D2\">public<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0991B6\">class<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #0444AC\">MyException<\/span><span style=\"color: #002339\">&lt;<\/span><span style=\"color: #0444AC\">T<\/span><span style=\"color: #002339\">&gt; <\/span><span style=\"color: #DA5221\">extends<\/span><span style=\"color: #002339\"> <\/span><span style=\"color: #B02767\">Exception<\/span><span style=\"color: #002339\"> { <\/span><span style=\"color: #357B42; font-style: italic\">\/\/ \u042d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #002339\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n    <div class=\"adv_youtube\">\r\n        <div class=\"adv_youtube_block g-bg-white d-flex align-items-center justify-content-center\">\r\n            <img decoding=\"async\" src=\"https:\/\/esvt4mphmap.exactdn.com\/wp-content\/themes\/foxminded\/icon\/general\/adv_logo.png?strip=all&quality=92&webp=92&avif=90&sharp=1&w=640\">\r\n            <div class=\"bubble_text\">\r\n                <span>\u041f\u043e\u0434\u043f\u0438\u0448\u0438\u0442\u0435\u0441\u044c \u043d\u0430 \u043d\u0430\u0448 \u042e\u0442\u0443\u0431-\u043a\u0430\u043d\u0430\u043b!<\/span> \u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u0435\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u0443\u0436\u0435 \u0436\u0434\u0443\u0442 \u0432\u0430\u0441!                <a class=\"btn btn-primary btn-primary-icon\" href=\"https:\/\/www.youtube.com\/c\/SergeyNemchinskiy\">\r\n                    <img decoding=\"async\" src=\"https:\/\/esvt4mphmap.exactdn.com\/wp-content\/themes\/foxminded\/icon\/general\/youtube_btn_icon.svg\">\r\n                    YouTube   \r\n                <\/a>\r\n            <\/div>\r\n        <\/div>\r\n        <div class=\"adv_mentoring_block g-bg-white d-flex align-items-center justify-content-center\">\r\n            <img decoding=\"async\" src=\"https:\/\/esvt4mphmap.exactdn.com\/wp-content\/themes\/foxminded\/icon\/general\/adv_logo.png?strip=all&quality=92&webp=92&avif=90&sharp=1&w=640\">\r\n            <div class=\"bubble_text\">\r\n                <span>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u043a\u0443\u0440\u0441!<\/span> \u041f\u0443\u0442\u044c \u043a \u043a\u0430\u0440\u044c\u0435\u0440\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c!                <a class=\"btn btn-primary\" href=\"https:\/\/foxminded.ua\/ru\/junior-course\/\">\r\n                    \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c                    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n                    <path d=\"M11.6927 5.8584L11.6927 9.19173L4.25937 9.19173L4.23437 10.8667L11.6927 10.8667L11.6927 14.1917L15.8594 10.0251L11.6927 5.8584Z\" fill=\"white\"\/>\r\n                    <\/svg>\r\n                <\/a>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n\n\n\n<h2 class=\"wp-block-heading\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u0432 \u0432 Java \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043c\u043e\u0449\u043d\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0438 \u0433\u0438\u0431\u043a\u0438\u043c. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0437-\u0437\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 Java \u0431\u044b\u043b \u0432\u043d\u0435\u0434\u0440\u0435\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432. \u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c generics \u0431\u0435\u0437 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u0432 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u0432 \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u0445, \u0437\u0430\u043f\u0440\u0435\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c generics \u0441 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0410\u043a\u0430\u0434\u0435\u043c\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/foxminded.ua\/ru\/\">FoxmindEd<\/a> \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432, \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0432\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0432 \u0440\u044f\u0434\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Java.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0430\u0436\u043d\u044b\u043c \u0434\u043b\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f generics \u0432 Java \u0438 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0425\u043e\u0442\u044f generics \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0441\u0442\u044b\u043c, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u043c.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Java \u0438 \u043a\u0430\u043a \u0435\u0435 \u0432\u044b\u0443\u0447\u0438\u0442\u044c?\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/uLESJ4atN-U?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043c\u043e\u0449\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432 Java, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 generics \u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 Generics \u0431\u044b\u043b\u0438 \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Java 5, \u0438 \u0432\u0441\u0442\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0441 [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-67235","post","type-post","status-publish","format-standard","hentry","category-learning"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generics \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java<\/title>\n<meta name=\"description\" content=\"\u0423\u0437\u043d\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generis \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442 \u0448\u043a\u043e\u043b\u044b FoxmindEd \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generics \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java\" \/>\n<meta property=\"og:description\" content=\"\u0423\u0437\u043d\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generis \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442 \u0448\u043a\u043e\u043b\u044b FoxmindEd \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/\" \/>\n<meta property=\"og:site_name\" content=\"FoxmindEd\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/foxmindedco\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-05T15:49:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-05T15:49:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/esvt4mphmap.exactdn.com\/wp-content\/uploads\/2025\/05\/foxminded_main_logo_with_descriptor_name_orange-1.png?strip=all&quality=92&webp=92&avif=90&sharp=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"554\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nemchyns\u02b9kyy Serhiy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nemchyns\u02b9kyy Serhiy\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u043c\u0438\u043d\u0443\u0442\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/foxminded.ua\\\/ru\\\/ogranicheniya-generics-i-stiranie-tipov\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/foxminded.ua\\\/ru\\\/ogranicheniya-generics-i-stiranie-tipov\\\/\"},\"author\":{\"name\":\"Nemchyns\u02b9kyy Serhiy\",\"@id\":\"https:\\\/\\\/foxminded.ua\\\/#\\\/schema\\\/person\\\/cc2955ca75c958d66beb74b6b994515c\"},\"headline\":\"\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f generics \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Generic \u043a\u043b\u0430\u0441\u0441\u0430\u0445\",\"datePublished\":\"2024-11-05T15:49:48+00:00\",\"dateModified\":\"2024-11-05T15:49:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/foxminded.ua\\\/ru\\\/ogranicheniya-generics-i-stiranie-tipov\\\/\"},\"wordCount\":689,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/foxminded.ua\\\/#organization\"},\"articleSection\":[\"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\"],\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/foxminded.ua\\\/ru\\\/ogranicheniya-generics-i-stiranie-tipov\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/foxminded.ua\\\/ru\\\/ogranicheniya-generics-i-stiranie-tipov\\\/\",\"url\":\"https:\\\/\\\/foxminded.ua\\\/ru\\\/ogranicheniya-generics-i-stiranie-tipov\\\/\",\"name\":\"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generics \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/foxminded.ua\\\/#website\"},\"datePublished\":\"2024-11-05T15:49:48+00:00\",\"dateModified\":\"2024-11-05T15:49:49+00:00\",\"description\":\"\u0423\u0437\u043d\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generis \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442 \u0448\u043a\u043e\u043b\u044b FoxmindEd \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/foxminded.ua\\\/ru\\\/ogranicheniya-generics-i-stiranie-tipov\\\/#breadcrumb\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/foxminded.ua\\\/ru\\\/ogranicheniya-generics-i-stiranie-tipov\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/foxminded.ua\\\/ru\\\/ogranicheniya-generics-i-stiranie-tipov\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043e\u043b\u043e\u0432\u043d\u0430\",\"item\":\"https:\\\/\\\/foxminded.ua\\\/ru\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f generics \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Generic \u043a\u043b\u0430\u0441\u0441\u0430\u0445\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/foxminded.ua\\\/#website\",\"url\":\"https:\\\/\\\/foxminded.ua\\\/\",\"name\":\"FoxmindEd\",\"description\":\"\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u0430\u0439\u0442 \u043d\u0430 WordPress\",\"publisher\":{\"@id\":\"https:\\\/\\\/foxminded.ua\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/foxminded.ua\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ru-RU\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/foxminded.ua\\\/#organization\",\"name\":\"FoxmindEd\",\"url\":\"https:\\\/\\\/foxminded.ua\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\\\/\\\/foxminded.ua\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/foxminded.ua\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/foxminded_sign_logo_orange.webp\",\"contentUrl\":\"https:\\\/\\\/foxminded.ua\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/foxminded_sign_logo_orange.webp\",\"width\":2063,\"height\":2222,\"caption\":\"FoxmindEd\"},\"image\":{\"@id\":\"https:\\\/\\\/foxminded.ua\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/foxmindedco\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/foxminded.ua\\\/#\\\/schema\\\/person\\\/cc2955ca75c958d66beb74b6b994515c\",\"name\":\"Nemchyns\u02b9kyy Serhiy\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generics \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java","description":"\u0423\u0437\u043d\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generis \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442 \u0448\u043a\u043e\u043b\u044b FoxmindEd \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/","og_locale":"ru_RU","og_type":"article","og_title":"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generics \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java","og_description":"\u0423\u0437\u043d\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generis \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442 \u0448\u043a\u043e\u043b\u044b FoxmindEd \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f!","og_url":"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/","og_site_name":"FoxmindEd","article_publisher":"https:\/\/www.facebook.com\/foxmindedco\/","article_published_time":"2024-11-05T15:49:48+00:00","article_modified_time":"2024-11-05T15:49:49+00:00","og_image":[{"width":1024,"height":554,"url":"https:\/\/esvt4mphmap.exactdn.com\/wp-content\/uploads\/2025\/05\/foxminded_main_logo_with_descriptor_name_orange-1.png?strip=all&quality=92&webp=92&avif=90&sharp=1","type":"image\/png"}],"author":"Nemchyns\u02b9kyy Serhiy","twitter_card":"summary_large_image","twitter_misc":{"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c":"Nemchyns\u02b9kyy Serhiy","\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f":"5 \u043c\u0438\u043d\u0443\u0442"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/#article","isPartOf":{"@id":"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/"},"author":{"name":"Nemchyns\u02b9kyy Serhiy","@id":"https:\/\/foxminded.ua\/#\/schema\/person\/cc2955ca75c958d66beb74b6b994515c"},"headline":"\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f generics \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Generic \u043a\u043b\u0430\u0441\u0441\u0430\u0445","datePublished":"2024-11-05T15:49:48+00:00","dateModified":"2024-11-05T15:49:49+00:00","mainEntityOfPage":{"@id":"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/"},"wordCount":689,"commentCount":0,"publisher":{"@id":"https:\/\/foxminded.ua\/#organization"},"articleSection":["\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435"],"inLanguage":"ru-RU","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/","url":"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/","name":"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generics \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java","isPartOf":{"@id":"https:\/\/foxminded.ua\/#website"},"datePublished":"2024-11-05T15:49:48+00:00","dateModified":"2024-11-05T15:49:49+00:00","description":"\u0423\u0437\u043d\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 generis \u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 Java \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442 \u0448\u043a\u043e\u043b\u044b FoxmindEd \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f!","breadcrumb":{"@id":"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/foxminded.ua\/ru\/ogranicheniya-generics-i-stiranie-tipov\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043e\u043b\u043e\u0432\u043d\u0430","item":"https:\/\/foxminded.ua\/ru\/"},{"@type":"ListItem","position":2,"name":"\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f generics \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Generic \u043a\u043b\u0430\u0441\u0441\u0430\u0445"}]},{"@type":"WebSite","@id":"https:\/\/foxminded.ua\/#website","url":"https:\/\/foxminded.ua\/","name":"FoxmindEd","description":"\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u0430\u0439\u0442 \u043d\u0430 WordPress","publisher":{"@id":"https:\/\/foxminded.ua\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/foxminded.ua\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ru-RU"},{"@type":"Organization","@id":"https:\/\/foxminded.ua\/#organization","name":"FoxmindEd","url":"https:\/\/foxminded.ua\/","logo":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/foxminded.ua\/#\/schema\/logo\/image\/","url":"https:\/\/foxminded.ua\/wp-content\/uploads\/2024\/08\/foxminded_sign_logo_orange.webp","contentUrl":"https:\/\/foxminded.ua\/wp-content\/uploads\/2024\/08\/foxminded_sign_logo_orange.webp","width":2063,"height":2222,"caption":"FoxmindEd"},"image":{"@id":"https:\/\/foxminded.ua\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/foxmindedco\/"]},{"@type":"Person","@id":"https:\/\/foxminded.ua\/#\/schema\/person\/cc2955ca75c958d66beb74b6b994515c","name":"Nemchyns\u02b9kyy Serhiy"}]}},"_links":{"self":[{"href":"https:\/\/foxminded.ua\/ru\/wp-json\/wp\/v2\/posts\/67235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/foxminded.ua\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/foxminded.ua\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/foxminded.ua\/ru\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/foxminded.ua\/ru\/wp-json\/wp\/v2\/comments?post=67235"}],"version-history":[{"count":8,"href":"https:\/\/foxminded.ua\/ru\/wp-json\/wp\/v2\/posts\/67235\/revisions"}],"predecessor-version":[{"id":67303,"href":"https:\/\/foxminded.ua\/ru\/wp-json\/wp\/v2\/posts\/67235\/revisions\/67303"}],"wp:attachment":[{"href":"https:\/\/foxminded.ua\/ru\/wp-json\/wp\/v2\/media?parent=67235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/foxminded.ua\/ru\/wp-json\/wp\/v2\/categories?post=67235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/foxminded.ua\/ru\/wp-json\/wp\/v2\/tags?post=67235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}