{"id":296786,"date":"2020-01-06T03:00:06","date_gmt":"2020-01-06T03:00:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=296786"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=296786","title":{"rendered":"Java: \u0432\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u043c\u0438 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0441\u043e \u0441\u0442\u0430\u0436\u0435\u043c"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/482950\/\">\u0414\u043e\u0431\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0442\u043e\u043a!<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043f\u043e \u0441\u043b\u0435\u0434\u0430\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/482364\">\u00ab\u0412\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b [\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e] \u043d\u0435 \u0437\u043d\u0430\u043b\u0438 \u043e Java\u00bb<\/a> \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0431\u044b \u043e\u0442\u043d\u0451\u0441 \u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u00ab\u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u00bb. \u0427\u0438\u0442\u0430\u044f \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044f \u0435\u0451, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0443\u0437\u043d\u0430\u043b, \u0443\u0436\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u044f \u043d\u0430 java \u043d\u0435 \u043e\u0434\u0438\u043d \u0433\u043e\u0434. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u0438 \u0432\u0435\u0449\u0438 \u043f\u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u0443-\u0442\u043e \u0435\u0449\u0451.<\/p>\n<p>  <a name=\"habracut\"><\/a>\u0424\u0430\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0441 \u043c\u043e\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c, \u044f \u0443\u0431\u0440\u0430\u043b \u0432 \u00ab\u0441\u043f\u043e\u0439\u043b\u0435\u0440\u044b\u00bb. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0435\u0449\u0438 \u0442\u0430\u043c \u0432\u0441\u0451-\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0438 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0430\u043c \u044f \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435 \u0437\u043d\u0430\u043b, \u0447\u0442\u043e Boolean.hashCode(true) == 1231 \u0438 Boolean.hashCode(false) == 1237.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445<\/b><\/p>\n<div class=\"spoiler_text\">\n<ul>\n<li>Boolean.hashCode(true) == 1231<\/li>\n<li>Boolean.hashCode(false) == 1237<\/li>\n<li>Float.hashCode(value) == Float.floatToIntBits(value)<\/li>\n<li>Double.hashCode(value) \u2014 xor \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0438 \u0432\u0442\u043e\u0440\u043e\u0433\u043e 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u043e\u043b\u0443\u0441\u043b\u043e\u0432 Double.doubleToLongBits(value)<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h2>Object.hashCode() \u0443\u0436\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438<\/h2>\n<p>  <a href=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/lang\/Object.html#hashCode--\" rel=\"nofollow\">\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0442\u0430\u043a.<\/a>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0441 11-\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 java, <a href=\"https:\/\/docs.oracle.com\/en\/java\/javase\/12\/docs\/api\/java.base\/java\/lang\/Object.html#hashCode()\" rel=\"nofollow\">\u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a<\/a>.<\/p>\n<h2>Integer.valueOf(15) == Integer.valueOf(15); Integer.valueOf(128) != Integer.valueOf(128)<\/h2>\n<p>  \u041e\u0433\u043e\u0432\u043e\u0440\u043a\u0430: \u044d\u0442\u043e \u0434\u0435\u0442\u0430\u043b\u044c oracle jvm.<\/p>\n<p>  \u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0434\u0432\u0443\u0445 \u043e\u0431\u0451\u0440\u0442\u043e\u043a \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c == (!=) \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e autoboxing \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u0412\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0432\u043e\u0435 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0441\u043c\u0443\u0449\u0430\u0435\u0442. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0446\u0435\u043b\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 i: -129 &lt; i &lt; 128 \u043e\u0431\u044a\u0435\u043a\u0442\u044b-\u043e\u0431\u0451\u0440\u0442\u043a\u0438 Integer \u043a\u044d\u0448\u0438\u0440\u0443\u044e\u0442\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f i \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 Integer.valueOf(i) \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439. \u0414\u043b\u044f i, \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0432 \u044d\u0442\u043e\u0442 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d, Integer.valueOf(i) \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0442\u0435\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0438 \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0440\u043e\u0434\u0435-\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u043a\u0440\u044b\u0442 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0442\u0430\u043a\u0438\u0435 \u0432\u043e\u0442 \u00ab\u0433\u0440\u0430\u0431\u043b\u0438\u00bb.<\/p>\n<h2>\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 final static \u043f\u043e\u043b\u0435\u0439 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/h2>\n<p>  \u0417\u0432\u0443\u0447\u0438\u0442 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e, \u0434\u0430 \u0438 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u043d\u043d\u043e\u0432\u0430\u0442\u043e. \u0421\u043c\u044b\u0441\u043b \u0442\u0430\u043a\u043e\u0439. \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u0430\u043a final static \u043f\u043e\u043b\u044f \u0441 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439,  <\/p>\n<pre><code class=\"java\">class AnotherClass {     public final static String CASE_1 = \"case_1\";     public final static String CASE_2 = \"case_2\"; } <\/code><\/pre>\n<p>  \u0442\u043e \u043f\u0440\u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445,<\/p>\n<pre><code class=\"java\">class TheClass {     \/\/ ...     public static int getCaseNumber(String caseName) {         switch (caseName) {             case AnotherClass.CASE_1:                 return 1;             case AnotherClass.CASE_2:                 return 2;             default:                 throw new IllegalArgumentException(\"value of the argument caseName does not belong to the allowed value set\");         }     } } <\/code><\/pre>\n<p>  \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 (\u00abcase_1\u00bb, \u00abcase_2\u00bb) \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u0418 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u0434 \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u043a\u0430\u043a \u0441\u0441\u044b\u043b\u043a\u0438. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c, \u043d\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442. \u0418\u043d\u0430\u0447\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442.<\/p>\n<p>  \u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u0433\u0434\u0435 \u043b\u0438\u0431\u043e \u043e\u0431\u044f\u0437\u0430\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, switch\/case), \u043b\u0438\u0431\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u043c \u0438 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>  \u042d\u0442\u0438 \u043f\u043e\u043b\u044f \u043d\u0435 \u0441\u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0443\u0431\u0435\u0440\u0451\u043c \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0431\u043b\u043e\u043a static.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445<\/b><\/p>\n<div class=\"spoiler_text\">\n<h2>\u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d<\/h2>\n<p>  \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043d\u0438 \u043e\u0434\u0438\u043d finalize() \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e finalize() \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0414\u0430 \u0438 \u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e\u043f\u0430\u043b \u0432 \u043c\u0443\u0441\u043e\u0440 \u043f\u0435\u0440\u0435\u0434 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c.<\/p>\n<h2>\u043c\u0435\u0442\u043e\u0434 finalize() \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u043d \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437<\/h2>\n<p>  \u0412 finalize() \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043d\u043e\u0432\u0430 \u0432\u0438\u0434\u0438\u043c\u044b\u043c, \u0438 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u0435\u0433\u043e \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043d\u0435 \u00ab\u0443\u0431\u0435\u0440\u0451\u0442\u00bb. \u041a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u043c\u0443\u0441\u043e\u0440, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u00ab\u0441\u043e\u0431\u0440\u0430\u043d\u00bb \u0431\u0435\u0437 \u0432\u044b\u0437\u043e\u0432\u0430 finalize(). \u0415\u0441\u043b\u0438 \u0432 finalize() \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u0447 \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u0432\u0438\u0434\u0438\u043c\u044b\u043c, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u043e\u043c \u00ab\u0441\u043e\u0431\u0440\u0430\u043d\u00bb. \u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e finalize() \u0432\u044b\u0437\u0432\u0430\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<h2>\u043f\u043e\u0442\u043e\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d finalize() \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d<\/h2>\n<p>  \u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043f\u043e\u0442\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u0435\u043d \u043e\u0442 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a, \u0432\u0438\u0434\u0438\u043c\u044b\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439.<\/p>\n<h2>\u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 finalize() \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0443\u0441\u043e\u0440\u0430<\/h2>\n<p>  \u0422\u043e \u0447\u0442\u043e \u043b\u0435\u0436\u0438\u0442 \u043d\u0430 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438, \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u2014 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c finalize(), \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430.<\/p>\n<h2>\u0441 dead locks \u0432 finalize() \u043e\u0447\u0435\u043d\u044c \u0442\u044f\u0436\u0435\u043b\u043e \u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f<\/h2>\n<p>  \u0412 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 finalize() \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0443, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435, \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<h2>Object.finalize() \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 9-\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 java \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u043a\u0430\u043a deprecated!<\/h2>\n<p>  \u0427\u0442\u043e \u043d\u0435\u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0443.<\/div>\n<\/div>\n<p>  <\/p>\n<h2>\u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u00ab\u043b\u0435\u043d\u0438\u0432\u0430\u044f\u00bb \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u0430: \u0434\u0432\u043e\u0439\u043d\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430<\/h2>\n<p>  \u041d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0435\u0441\u0442\u044c \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 (double-check idiom), \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0449\u0438\u0439 \u0432\u0435\u0441\u044c\u043c\u0430 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:  <\/p>\n<pre><code class=\"java\">public class UnsafeDCLFactory {     private Singleton instance;      public Singleton get() {         if (instance == null) {  \/\/ read 1, check 1             synchronized (this) {                 if (instance == null) { \/\/ read 2, check 2                     instance = new Singleton();                 }             }         }         return instance; \/\/ read 3     } } <\/code><\/pre>\n<p>  \u041c\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0441\u043e\u0437\u0434\u0430\u043d \u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 (read 1, check 1). \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0435\u0433\u043e. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0441\u0442\u0430\u0432\u0438\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443, \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043d, \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442, (\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0443\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f), \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>  \u041f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c. (read 1, check 1) \u0438 (read 3) \u043d\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u041f\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 java, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443, \u043f\u043e\u043a\u0430 \u043c\u044b \u043d\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u0441\u044f. \u041b\u0435\u0447\u0438\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438, \u043b\u0438\u0431\u043e \u043f\u043e\u043c\u0435\u0442\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0436\u0438\u0432\u0451\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d, volatile. (\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 volatile \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 java 5+. \u0414\u043e \u044d\u0442\u043e\u0433\u043e \u0432 java \u0431\u044b\u043b\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0441 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438.) \u0412\u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 (\u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f `res`, \u0447\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0442\u0435\u043d\u0438\u0439 \u0438\u0437 volatile \u043f\u043e\u043b\u044f).  <\/p>\n<pre><code class=\"java\">public class SafeLocalDCLFactory {     private volatile Singleton instance;      public Singleton getInstance() {         Singleton res = instance;     \/\/ read 1         if (res == null) {            \/\/ check 1             synchronized (this) {                 res = instance;       \/\/ read 2                 if (res == null) {    \/\/ check 2                     res = new Singleton();                     instance = res;                 }             }         }         return res;     } } <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0432\u0437\u044f\u0442 <a href=\"https:\/\/shipilev.net\/blog\/2014\/safe-public-construction\/\" rel=\"nofollow\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>, \u0441 \u0441\u0430\u0439\u0442\u0430 \u0410\u043b\u0435\u043a\u0441\u0435\u044f \u0428\u0438\u043f\u0438\u043b\u0451\u0432\u0430. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0451\u043c \u0436\u0435.<\/p>\n<h2>\u00abinitialization-on-demand holder idiom\u00bb \u2014 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f \u00ab\u043b\u0435\u043d\u0438\u0432\u0430\u044f\u00bb \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u0430<\/h2>\n<p>  java \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u044b (Class objects) \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u0418 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f! \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u00abinitialization-on-demand holder idiom\u00bb \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438\u043c \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f. (\u041a\u043e\u0434 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Initialization-on-demand_holder_idiom\" rel=\"nofollow\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>.)  <\/p>\n<pre><code class=\"java\">public class Something {     private Something() {}      private static class LazyHolder {         static final Something INSTANCE = new Something();     }      public static Something getInstance() {         return LazyHolder.INSTANCE;     } } <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441 LazyHolder \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 Something.getInstance(). Jvm \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u043f\u0440\u0438\u0442\u043e\u043c \u0432\u0435\u0441\u044c\u043c\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u2014 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u0443\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, LazyHolder.INSTANCE \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b, \u00ab\u043b\u0435\u043d\u0438\u0432\u043e\u00bb \u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043a\u0443\u0441\u043e\u043a \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b<\/b><\/p>\n<div class=\"spoiler_text\"> If this initialization procedure completes normally and the Class object is fully initialized and ready for use, then the invocation of the initialization procedure is no longer necessary and it may be eliminated from the code \u2014 for example, by patching it out or otherwise regenerating the code.<br \/>  <a href=\"https:\/\/docs.oracle.com\/javase\/specs\/jls\/se8\/html\/jls-12.html#jls-12.4\" rel=\"nofollow\">\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a.<\/a><\/div>\n<\/div>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u044b \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0441\u0430\u043c\u043e\u0439 \u043b\u0443\u0447\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439.<\/p>\n<p>  \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0441\u044f. \u0422\u0430\u043a \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u00ab\u0434\u043e\u0439\u0434\u0443\u0442\u00bb \u0440\u0443\u043a\u0438 \u0438 \u0442\u043e, \u0447\u0442\u043e \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043e, \u043d\u0430\u043f\u0438\u0448\u0443 \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0449\u0451 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443.<\/p><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/482950\/\"> https:\/\/habr.com\/ru\/post\/482950\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/482950\/\">\u0414\u043e\u0431\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0442\u043e\u043a!<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043f\u043e \u0441\u043b\u0435\u0434\u0430\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/482364\">\u00ab\u0412\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b [\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e] \u043d\u0435 \u0437\u043d\u0430\u043b\u0438 \u043e Java\u00bb<\/a> \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0431\u044b \u043e\u0442\u043d\u0451\u0441 \u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u00ab\u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u00bb. \u0427\u0438\u0442\u0430\u044f \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044f \u0435\u0451, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0443\u0437\u043d\u0430\u043b, \u0443\u0436\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u044f \u043d\u0430 java \u043d\u0435 \u043e\u0434\u0438\u043d \u0433\u043e\u0434. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u0438 \u0432\u0435\u0449\u0438 \u043f\u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u0443-\u0442\u043e \u0435\u0449\u0451.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-296786","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=296786"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296786\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}