{"id":1234,"date":"2010-07-16T08:41:24","date_gmt":"2010-07-16T08:41:24","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=1234"},"modified":"2017-01-29T08:59:25","modified_gmt":"2017-01-28T23:59:25","slug":"java-%ed%8c%8c%ec%83%9d-%ed%81%b4%eb%9e%98%ec%8a%a4%ea%b0%80-%ec%95%84%eb%8b%88%eb%9d%bc-%eb%94%b1-%eb%82%b4-%ed%81%b4%eb%9e%98%ec%8a%a4%ec%9d%b4%ea%b0%80","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=1234","title":{"rendered":"[Java] \ud30c\uc0dd \ud074\ub798\uc2a4\uac00 \uc544\ub2c8\ub77c.. \ub531 \ub0b4 \ud074\ub798\uc2a4\uc778\uac00?"},"content":{"rendered":"<p>\ubb50.. \uc81c\ubaa9\uc774 \uc800\ub798.. \ub77c\uace0 \uc0dd\uac01\ud558\uc2dc\ub294 \ubd84\ub3c4 \ubd84\uba85 \uacc4\uc2e4\ud14c\uace0.. \uc800 \uc5ed\uc2dc \ubb50 \uc81c\ubaa9\uc774 \uc774\ub798.. \ub77c\uace0 \uc0dd\uac01\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.. \uba3c\uc800 \uc544\ub798\uc640 \uac19\uc740 \ud074\ub798\uc2a4 \uacc4\uce35\uc774 \uc788\ub2e4\uace0 \uce69\uc2dc\ub2e4..<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/1\/1089547332.png\" alt=\"\uc0ac\uc6a9\uc790 \uc0bd\uc785 \uc774\ubbf8\uc9c0\" width=\"407\" height=\"202\" \/><br \/>\nGeometry\ub97c \ubd80\ubaa8\ub85c \ud558\ub294 \uc138\uac1c\uc758 \uc790\uc2dd \ud074\ub798\uc2a4\uc785\ub2c8\ub2e4.. \uc608\ub97c \ub4e4\uc5b4 \uc544\ub798\ucc98\ub7fc \ucf54\ub529\uc744 \ud588\uc2b5\ub2c8\ub2e4..<\/p>\n<pre>\r\nGeometry g = new Rectangle();<\/pre>\n<p>\uc774\uc81c \uc774\uc81c g \uac1d\uccb4\uac00 Circle\uc774\ub0d0.. Rectangle\uc774\ub0d0.. \uc544\ub2c8\uba74 Triangle\uc774\ub0d0.. \uc544\ub2c8\uba74.. Geometry\uc774\ub0d0\ub97c \uc5b4\ub5bb\uac8c \uc54c \uc218 \uc788\uc744\uae4c\uc694? \ubb50 \uc774\ub7f0\uac70\uc57c.. \uc790\ubc14\uc5d0\ub294 \ud3b8\ub9ac\ud55c instanceof\uac00 \uc788\uc73c\ub2c8 \uc544\ub798\ucc98\ub7fc \ud558\uba74\ub418\uc9c0\ub77c\uba70.. \ucf54\ub529\ud569\ub2c8\ub2e4..<\/p>\n<pre>\r\nGeometry g = new Rectangle();\r\n\r\nif(g instanceof Rectangle) {\r\n\u00a0 \u00a0 System.out.println(\"Type is Rectangle\");\r\n}\r\n\r\nif(g instanceof Circle) {\r\n\u00a0 \u00a0 System.out.println(\"Type is Circle\");\r\n}\r\n\r\nif(g instanceof Triangle) {\r\n\u00a0 \u00a0 System.out.println(\"Type is Triangle\");\r\n}\r\n\r\nif(g instanceof Geometry) {\r\n\u00a0 \u00a0 System.out.println(\"Type is Geometry\");\r\n}<\/pre>\n<p>\uc790\ubc14\ub97c \uc798\uc544\uc2e0\ub2e4\uba74.. \uc5b4.. \uc774\uac70 \uc544\ub2cc\ub370.. \ub77c\uace0 \ubc14\ub85c \ud558\uc2e4\ud14c\uc9c0\ub9cc.. \uc800\ub294 \ub2e8\uc9c0.. \uadf8\ub0e5 \ub0c4\uc0c8\uac00 \uc880 \ub098\ub294\ub370.. \ub294 \uc815\ub3c4\uc600\ub2f5\ub2c8\ub2e4.. \uc5ec\ud2bc, \uc2e4\ud589\ud574\ubcf4\uba74 2\uac1c\uc758 \uc870\uac74\ubb38\uc5d0\uc11c true\ub97c \ub9cc\ub098\uac8c \ub429\ub2c8\ub2e4.. 3\ubc88 \ucf54\ub4dc\uc758 if \ubb38\uacfc 15\ubc88 \ucf54\ub4dc\uc758 if \ubb38.. \uc989 g\ub294 Rectangle\uc774\uba74\uc11c \ub3d9\uc2dc\uc5d0 Geometry \ud0c0\uc785\uc785\ub2c8\ub2e4.. \ub2f9\uc5f0\ud55c \uacb0\uacfc\uc774\uc9c0\uc694.. \ud558\uc9c0\ub9cc \uc6d0\ud558\ub294 \uac83\uc740 \ub531&#8230; &#8220;\ub098\ub294 \ub098\ub2e4!&#8221;\ub77c\ub294 \uac83\uc774\uc8e0.. \uc989, \uc704\uc758 \uacbd\uc6b0\uc5d0\ub294 g\ub294 Geometry\uac00 \uc544\ub2c8\ub77c Rectangle\ub2e4! \ub77c\ub294 \uac83\uc744 \ud310\ubcc4\ud574\uc57c \ud55c\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4..<\/p>\n<p>\uc790\ubc14\ub294 C\/C++ \uc5b8\uc5b4\uac00 \uac00\uc9c0\uc9c0 \ubabb\ud55c \uac15\ub825\ud55c \uae30\ub2a5\uc774 \uc788\uc2b5\ub2c8\ub2e4.. \uc2e4\ud589\uc2dc\uac04\uc5d0\uc11c\uc758 \ud0c0\uc785 \uc815\ubcf4(RTTI)\uc778\ub370\uc694.. \uc774 RTTI\ub97c \uc704\ud574 \uc790\ubc14\ub294 \ubaa8\ub4e0 \uac1d\uccb4\uc5d0 \ub300\ud574\uc11c \uc790\uc2e0\uc758 \ud0c0\uc785\uc5d0 \ub300\ud55c \uc815\ubcf4\ub97c \ub2f4\uace0 \uc788\uc2b5\ub2c8\ub2e4.. \uc774\ub97c \uc774\uc6a9\ud574 \uc6b0\ub9ac\uac00 \uc6d0\ud558\ub294 \ubc14\ub97c \uc5bb\uc744 \uc218 \uc788\ub294 \ucf54\ub4dc\ub294 \uc544\ub798\uc640 \uac19\uc2b5\ub2c8\ub2e4..<\/p>\n<pre>\r\nGeometry g = new Rectangle();\r\n\r\nif(g.getClass() == Rectangle.class) {\r\n\u00a0 \u00a0 System.out.println(\"Type is Rectangle\");\r\n}\r\n\r\nif(g.getClass() == Circle.class) {\r\n\u00a0 \u00a0 System.out.println(\"Type is Circle\");\r\n}\r\n\r\nif(g.getClass() == Triangle.class) {\r\n\u00a0 \u00a0 System.out.println(\"Type is Triangle\");\r\n}\r\n\r\nif(g.getClass() == Geometry.class) {\r\n\u00a0 \u00a0 System.out.println(\"Type is Geometry\");\r\n}<\/pre>\n<p>\uc774\uc81c \uc815\ud655\ud788.. \uc624\uc9c1 3\ubc88 \ucf54\ub4dc\uc5d0 \ub300\ud55c if\ubb38\uc5d0\uc11c\ub9cc true\uc778, &#8220;\ub098\ub294 \ub098\ub2e4!&#8221;\ub77c\ub294 \uacb0\uacfc\ub97c \uc5bb\uc744 \uc218 \uc788\uac8c \ub429\ub2c8\ub2e4..<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ubb50.. \uc81c\ubaa9\uc774 \uc800\ub798.. \ub77c\uace0 \uc0dd\uac01\ud558\uc2dc\ub294 \ubd84\ub3c4 \ubd84\uba85 \uacc4\uc2e4\ud14c\uace0.. \uc800 \uc5ed\uc2dc \ubb50 \uc81c\ubaa9\uc774 \uc774\ub798.. \ub77c\uace0 \uc0dd\uac01\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.. \uba3c\uc800 \uc544\ub798\uc640 \uac19\uc740 \ud074\ub798\uc2a4 \uacc4\uce35\uc774 \uc788\ub2e4\uace0 \uce69\uc2dc\ub2e4.. Geometry\ub97c \ubd80\ubaa8\ub85c \ud558\ub294 \uc138\uac1c\uc758 \uc790\uc2dd \ud074\ub798\uc2a4\uc785\ub2c8\ub2e4.. \uc608\ub97c \ub4e4\uc5b4 \uc544\ub798\ucc98\ub7fc \ucf54\ub529\uc744 \ud588\uc2b5\ub2c8\ub2e4.. Geometry g = new Rectangle(); \uc774\uc81c \uc774\uc81c g \uac1d\uccb4\uac00 Circle\uc774\ub0d0.. Rectangle\uc774\ub0d0.. \uc544\ub2c8\uba74 Triangle\uc774\ub0d0.. \uc544\ub2c8\uba74.. Geometry\uc774\ub0d0\ub97c \uc5b4\ub5bb\uac8c \uc54c \uc218 \uc788\uc744\uae4c\uc694? \ubb50 \uc774\ub7f0\uac70\uc57c.. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=1234\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[Java] \ud30c\uc0dd \ud074\ub798\uc2a4\uac00 \uc544\ub2c8\ub77c.. \ub531 \ub0b4 \ud074\ub798\uc2a4\uc778\uac00?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60],"tags":[51],"class_list":["post-1234","post","type-post","status-publish","format-standard","hentry","category-java","tag-java"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1234"}],"version-history":[{"count":1,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1234\/revisions"}],"predecessor-version":[{"id":3327,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1234\/revisions\/3327"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1234"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}