{"id":1898,"date":"2018-04-30T11:54:36","date_gmt":"2018-04-30T02:54:36","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=1898"},"modified":"2023-05-27T20:41:11","modified_gmt":"2023-05-27T11:41:11","slug":"%e3%80%90java%e5%9f%ba%e7%a4%8e%e3%80%91%e7%b6%99%e6%89%bf%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=1898","title":{"rendered":"\u3010Java\u3011\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\uff1a\u7d99\u627f\u306e\u8003\u3048\u65b9\u3084\u6ce8\u610f\u70b9"},"content":{"rendered":"<h2>\u7279\u5fb4<\/h2>\n<p>\u3042\u308b\u30af\u30e9\u30b9\u3092\u30d9\u30fc\u30b9\u306b\u3057\u3066\u3001\u65b0\u3057\u3044\u30af\u30e9\u30b9\u3092\u4f5c\u308b\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3002<\/p>\n<h2>\u7d99\u627f\u306e\u30e1\u30ea\u30c3\u30c8<\/h2>\n<p>\u30b3\u30fc\u30c9\u306e\u91cd\u8907\u3092\u6392\u9664\u3067\u304d\u308b\u3053\u3068\u3002\u4f8b\u3048\u3070\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u304b\u3067\u3042\u308c\u3070\u3001\u30a8\u30e9\u30fc\u51e6\u7406\u306a\u3069\u3069\u306e\u30b3\u30fc\u30c9\u3067\u3082\u304a\u6c7a\u307e\u308a\u306a\u51e6\u7406\u306a\u3069\u306f\u7d99\u627f\u306a\u3069\u3067\u5171\u901a\u5316\u3057\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<h2>\u7d99\u627f\u306e\u4f7f\u3044\u65b9<\/h2>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306a\u56f3\u306e\u7d99\u627f\u3092\u3055\u305b\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2257\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u7d99\u627f.png\" alt=\"\" width=\"305\" height=\"300\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u7d99\u627f.png 305w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u7d99\u627f-300x295.png 300w\" sizes=\"(max-width: 305px) 100vw, 305px\" \/><\/p>\n<h3>\u89aa\u30af\u30e9\u30b9<\/h3>\n<pre class=\"lang:default decode:true\">public class People {\r\n\r\n\tString name; \/\/\u540d\u524d\r\n\tint weight;  \/\/\u4f53\u91cd\r\n\tString pc;\/\/\u30d1\u30bd\u30b3\u30f3\r\n\r\n\tPeople(String name,int weight){\r\n\t\tthis.name = name;\r\n\t\tthis.weight = weight;\r\n\t}\r\n\r\n\t\/\/\u81ea\u5df1\u7d39\u4ecb\r\n\tvoid selfIntroduction() {\r\n\t}\r\n\r\n}\r\n<\/pre>\n<h3>\u5b50\u30af\u30e9\u30b9<\/h3>\n<pre class=\"lang:default decode:true\">public class Japanese extends People {\r\n\r\n\tJapanese(String name,int weight){\r\n\t\tsuper(name,weight);\r\n\t}\r\n\r\n\tvoid selfIntroduction() {\r\n\t\tSystem.out.println(name + \"\u3055\u3093\u306f\u65e5\u672c\u4eba\u3067\u3059\u3002\");\r\n\t\tSystem.out.println(\"\u4f53\u91cd\u306f\u3001\"+ weight + \"kg\u3067\u3059\u3002\");\r\n\t}\r\n\r\n}<\/pre>\n<h3>\u7d99\u627f\u3055\u305b\u305f\u30af\u30e9\u30b9\u3092\u547c\u3073\u51fa\u3059\u3002<\/h3>\n<p>\u7d99\u627f\u3055\u305b\u305f\u30af\u30e9\u30b9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002\u57fa\u672c\u7684\u306b\u306f\u3001\u5b50\u30af\u30e9\u30b9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">public class Main {\r\n\tpublic static void main(String args[]) {\r\n\r\n\t\tJapanese taro = new Japanese(\"\u592a\u90ce\",60);\r\n\t\ttaro.selfIntroduction();;\r\n\r\n\t}\r\n}<\/pre>\n<h4>\u5b9f\u884c\u7d50\u679c<\/h4>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2258\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u7d99\u627f_\u5b9f\u884c\u7d50\u679c.png\" alt=\"\" width=\"275\" height=\"107\" \/><\/p>\n<h2>\u7d99\u627f\u306e\u5236\u7d04<\/h2>\n<h3>\u7d99\u627f\u304c\u3067\u304d\u306a\u3044\u30af\u30e9\u30b9\u304c\u3042\u308b\u3002<\/h3>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306bfinal\u304c\u3064\u3044\u305f\u30af\u30e9\u30b9\u306f\u7d99\u627f\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"lang:default decode:true\">public final class Book {\r\n\u3000\/\/\u51e6\u7406\r\n}<\/pre>\n<p>\u307e\u305f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306bfinal\u3092\u3064\u3051\u305f\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u5b50\u30af\u30e9\u30b9\u3067\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"lang:default decode:true\">public final class Book {\r\n\r\n\tprivate String name;\r\n\r\n        \/\/\u2605\u5b50\u30af\u30e9\u30b9\u3067\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3067\u304d\u306a\u3044\u3002\r\n\tpublic final String getName() {\r\n\t\treturn name;\r\n\t}\r\n\r\n}<\/pre>\n<h3>\u30b5\u30d6\u30af\u30e9\u30b9\u306b\u5f15\u304d\u7d99\u304c\u308c\u306a\u3044\u30e1\u30f3\u30d0\u304c\u3042\u308b\u3002<\/h3>\n<p>private\u3092\u3064\u3051\u3066\u5ba3\u8a00\u3057\u305f\u30d5\u30a3\u30fc\u30eb\u30c9\u3084\u3001\u30e1\u30bd\u30c3\u30c9<\/p>\n<p>static\u3092\u3064\u3051\u3066\u5ba3\u8a00\u3055\u308c\u305f\u30e1\u30f3\u30d0<\/p>\n<h2>\u6b63\u3057\u3044\u7d99\u627f\u95a2\u4fc2<\/h2>\n<h3>is-a\uff08\u6c4e\u5316\u2192\u7279\u5316\uff09\u306b\u306a\u3063\u3066\u3044\u308b\u7d99\u627f<\/h3>\n<p>\u300cis-a\u300d\u3068\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u5b50\u30af\u30e9\u30b9\u304c\u3001\u89aa\u30af\u30e9\u30b9\u306e\u4e00\u7a2e\u306b\u306a\u3063\u3066\u3044\u308b\u95a2\u4fc2\u306e\u3053\u3068\u300d<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u300c\u672c\u30af\u30e9\u30b9\u300d\u3092\u7d99\u627f\u3055\u305b\u3066\u3001\u300c\u5c02\u9580\u66f8\u30af\u30e9\u30b9\u300d\u3092\u4f5c\u308b\u306e\u3067\u3042\u308c\u3070\u3001\u300c\u5c02\u9580\u66f8\u30af\u30e9\u30b9\u306f\u3001\u672c\u30af\u30e9\u30b9\u306e\u4e00\u7a2e\u3067\u3042\u308b\u300d\u3068\u3044\u3048\u3001is-a\uff08\u6c4e\u5316\u2192\u7279\u5316\uff09\u95a2\u4fc2\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3044\u3048\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u300c\u7269\u30af\u30e9\u30b9\u300d\u304c\u3042\u3063\u3066\u3001\u300c\u5c02\u9580\u66f8\u30af\u30e9\u30b9\u300d\u3092\u4f5c\u308b\u306e\u3067\u3042\u308c\u3070\u3001\u4f55\u304b\u9055\u3046\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u305d\u3046\u3044\u3063\u305f\u3001\u9055\u548c\u611f\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u5f8c\u3067\u8aa4\u89e3\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u306e\u3067\u7d99\u627f\u3057\u306a\u3044\u65b9\u304c\u7121\u96e3<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<h2>\u7d99\u627f\u306e\u554f\u984c\u70b9<\/h2>\n<p>\u305f\u3060\u3001\u305f\u3060\u3001\u7d99\u627f\u3092\u4f7f\u3048\u3070\u3044\u3044\u3068\u3044\u3046\u308f\u3051\u3067\u306f\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u7d99\u627f\u3092\u4f7f\u3063\u3066\u3044\u304f\u3068\u3044\u304f\u3064\u304b\u306e\u554f\u984c\u70b9\u304c\u51fa\u3066\u304d\u307e\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"JytMqsLzzF\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=2246\">\u3010Java\u3011\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\uff1a\u7d99\u627f\u306e\u554f\u984c\u70b9\u3092\u89e3\u6c7a\u3059\u308b\u300c\u62bd\u8c61\u30af\u30e9\u30b9\u300d\u3001\u300c\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u300d<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=2246&#038;embed=true#?secret=JytMqsLzzF\" data-secret=\"JytMqsLzzF\" width=\"500\" height=\"282\" title=\"&#8220;\u3010Java\u3011\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\uff1a\u7d99\u627f\u306e\u554f\u984c\u70b9\u3092\u89e3\u6c7a\u3059\u308b\u300c\u62bd\u8c61\u30af\u30e9\u30b9\u300d\u3001\u300c\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u300d&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"\u7279\u5fb4 \u3042\u308b\u30af\u30e9\u30b9\u3092\u30d9\u30fc\u30b9\u306b\u3057\u3066\u3001\u65b0\u3057\u3044\u30af\u30e9\u30b9\u3092\u4f5c\u308b\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3002 \u7d99\u627f\u306e\u30e1\u30ea\u30c3\u30c8 \u30b3\u30fc\u30c9\u306e\u91cd\u8907\u3092\u6392\u9664\u3067\u304d\u308b\u3053\u3068\u3002\u4f8b\u3048\u3070\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u304b\u3067\u3042\u308c\u3070\u3001\u30a8\u30e9\u30fc\u51e6\u7406\u306a\u3069\u3069\u306e\u30b3\u30fc\u30c9\u3067\u3082\u304a\u6c7a\u307e\u308a\u306a\u51e6\u7406\u306a\u3069\u306f\u7d99\u627f\u306a\u3069\u3067\u5171\u901a\u5316 [&hellip;]","protected":false},"author":1,"featured_media":2014,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,29],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/1898"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1898"}],"version-history":[{"count":15,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/1898\/revisions"}],"predecessor-version":[{"id":20246,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/1898\/revisions\/20246"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/2014"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1898"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}