{"id":180,"date":"2024-08-16T10:39:08","date_gmt":"2024-08-16T01:39:08","guid":{"rendered":"https:\/\/techfun.cc\/?p=180"},"modified":"2025-06-10T11:33:15","modified_gmt":"2025-06-10T02:33:15","slug":"java_base_polymorphism","status":"publish","type":"post","link":"https:\/\/techfun.cc\/java-base\/java_base_polymorphism.html","title":{"rendered":"\u30dd\u30ea\u30e2\u30d5\u30a3\u30ba\u30e0"},"content":{"rendered":"<h3 class=\"Heading Title Title--m\" id=\"Bookmark-1\"><span class=\"Num\">1.<\/span>\u672c\u7ae0\u3067\u306e\u5b66\u7fd2\u9805\u76ee<\/h3>\n<p>\u672c\u7ae0\u3067\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u884c\u3046\u306e\u306b\u91cd\u8981\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u3067\u3042\u308b\u30dd\u30ea\u30e2\u30d5\u30a3\u30ba\u30e0\uff08\u591a\u614b\u6027\uff09\u306b\u95a2\u3057\u3066\u5b66\u7fd2\u3057\u307e\u3059\u3002<\/p>\n<div class=\"Separator\">\n<div class=\"Separator__child\"><\/div>\n<\/div>\n<h3 class=\"Heading Title Title--m\" id=\"Bookmark-2\"><span class=\"Num\">2.<\/span>\u672c\u7ae0\u306e\u8b1b\u7fa9<\/h3>\n<p>\u672c\u7ae0\u3067\u5b66\u7fd2\u3059\u308b\u5185\u5bb9\u3092\u52d5\u753b\u3068\u3057\u3066\u307e\u3068\u3081\u305f\u3082\u306e\u3067\u3059\u3002\u6700\u521d\u306b\u4e00\u901a\u308a\u898b\u7d42\u308f\u3063\u305f\u5f8c\u3067\u3001\u5b66\u7fd2\u306b\u5165\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"Video-block\">\n<div class=\"Video-block__title\">\u8b1b\u7fa9:\u30dd\u30ea\u30e2\u30d5\u30a3\u30ba\u30e0<\/div>\n<div class=\"Video-block__video Youtube\">\n\t\t<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube-nocookie.com\/embed\/QQdrC2ZQJGo?si=LgdW7CFlOOdH8umR&#038;rel=0\"\n\t\t\ttitle=\"YouTube video player\" frameborder=\"0\"\n\t\t\tallow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n\t\t\treferrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n\t<\/div>\n<\/div>\n<div class=\"Separator\">\n<div class=\"Separator__child\"><\/div>\n<\/div>\n<h3 class=\"Heading Title Title--m\" id=\"Bookmark-3\"><span class=\"Num\">3.<\/span>\u30dd\u30ea\u30e2\u30d5\u30a3\u30ba\u30e0\u3068\u306f<\/h3>\n<p>\u30dd\u30ea\u30e2\u30d5\u30a3\u30ba\u30e0\u306f\u3001\u300c\u591a\u614b\u6027\u300d\u3068\u547c\u3070\u308c\u308b\u3082\u306e\u3067\u3059\u3002<br \/>\n\u300c\u7570\u306a\u308b\u30c7\u30fc\u30bf\u578b\u306e\u5f15\u6570\u3084\u7570\u306a\u308b\u6570\u306e\u5f15\u6570\u3092\u3001\u540c\u3058\u540d\u524d\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u305d\u308c\u305e\u308c\u7570\u306a\u308b\u51e6\u7406\u3067\u5bfe\u5fdc\u3059\u308b\u6a5f\u80fd\u300d\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<br \/>\n\u5229\u7528\u3055\u308c\u308b\u30af\u30e9\u30b9\u304b\u3089\u751f\u6210\u3055\u308c\u305f1\u3064\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u307f\u3001\u307e\u305f\u306f\u3001\u540c\u3058\u3088\u3046\u306a\u6a5f\u80fd\u3092\u6301\u3064\u7570\u306a\u308b\u30af\u30e9\u30b9\u304b\u3089\u751f\u6210\u3055\u308c\u305f\u8907\u6570\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3001\u540c\u3058\u540d\u524d\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u51e6\u7406\u306e\u591a\u69d8\u6027\u3092\u9ad8\u3081\u308b\u305f\u3081\u306b\u7528\u3044\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u304a\u3051\u308b\u91cd\u8981\u306a\u6280\u6cd5\u3067\u3059\u3002<\/p>\n<p>\u30dd\u30ea\u30e2\u30d5\u30a3\u30ba\u30e0\u3067\u306f\u3001\u591a\u69d8\u306a\u30e1\u30bd\u30c3\u30c9\u306e\u5b9a\u7fa9\u3092\u3057\u3001\u305d\u308c\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u4e3b\u306b\u6b21\u306e3\u901a\u308a\u306e\u624b\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n1\u3064\u76ee\u306f\u3001<span class=\"Text-highlight\">\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9<\/span>\u30012\u3064\u76ee\u306f\u3001<span class=\"Text-highlight\">\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9<\/span>\u30013\u3064\u76ee\u306f\u3001<span\n\tclass=\"Text-highlight\">\u62bd\u8c61\u30af\u30e9\u30b9\u3068\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9<\/span>\u3068\u3044\u3046\u624b\u6cd5\u3067\u3059\u3002<br \/>\n\u3053\u308c\u304b\u3089\u3001\u3053\u308c\u3089\u306e\u6280\u8853\u3092\u5b66\u7fd2\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"Separator\">\n<div class=\"Separator__child\"><\/div>\n<\/div>\n<h3 class=\"Heading Title Title--m\" id=\"Bookmark-4\"><span class=\"Num\">4.<\/span>\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9<\/h3>\n<p>\u307e\u305a\u6700\u521d\u306f\u3001<span class=\"Text-highlight\">\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9<\/span>\u3067\u3059\u3002<br \/>\n\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3068\u306f\u3001\u4e00\u3064\u306e\u30af\u30e9\u30b9\u306e\u4e2d\u306b\u3001\u7570\u306a\u308b\u5f15\u6570\u306e\u6570\u307e\u305f\u306f\u578b\u3092\u6301\u3064\u540c\u3058\u540d\u524d\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u8907\u6570\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u4eca\u307e\u3067\u4e00\u3064\u306e\u30af\u30e9\u30b9\u306e\u4e2d\u306b\u8907\u6570\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u305d\u308c\u305e\u308c\u7570\u306a\u308b\u30e1\u30bd\u30c3\u30c9\u540d\u3092\u3064\u3051\u3066\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u4e00\u3064\u306e\u30af\u30e9\u30b9\u5185\u306b\u540c\u3058\u540d\u524d\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u8907\u6570\u6301\u3064\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3057\u3001\u30e1\u30bd\u30c3\u30c9\u540d\u306f\u540c\u3058\u3067\u3082\u5f15\u6570\u3084\u623b\u308a\u5024\u304c\u9055\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u6761\u4ef6\u306b\u306a\u308a\u307e\u3059\u3002\u30e1\u30bd\u30c3\u30c9\u306e\u540d\u524d\u3068\u5f15\u6570\u306e\u7d44\u307f\u5408\u308f\u305b\u3092<span class=\"Text-highlight\">\u300c\u30b7\u30b0\u30cd\u30c1\u30e3\u30fc\u300d<\/span>\u3068\u547c\u3073\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u30b7\u30b0\u30cd\u30c1\u30e3\u30fc\u304c\u540c\u3058\u30e1\u30bd\u30c3\u30c9\u306f\u540c\u3058\u30af\u30e9\u30b9\u5185\u3067\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3067\u304d\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u3001\u300c\u3088\u304f\u4f7f\u3046\u30af\u30e9\u30b9\u300d\u306e\u7ae0\u3067\u4f55\u5ea6\u304b\u4f7f\u7528\u3057\u305fString\u30af\u30e9\u30b9\u306eindexOf\u30e1\u30bd\u30c3\u30c9\u3092\u898b\u3066\u307f\u307e\u3059\u3002JavaDoc\u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5f15\u6570\u306e\u7570\u306a\u308bindexOf\u30e1\u30bd\u30c3\u30c9\u304c\u8907\u6570\u5b58\u5728\u3059\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<p><a class=\"Ext Image-link\" href=\"https:\/\/techfun.cc\/wp-content\/uploads\/2024\/10\/polymorphism-overload0.png\"><br \/>\n\t<img decoding=\"async\" src=\"https:\/\/techfun.cc\/wp-content\/uploads\/2024\/10\/polymorphism-overload0.png\" alt=\"overload0\"><br \/>\n<\/a><\/p>\n<p>\u300c\u3088\u304f\u4f7f\u3046\u30af\u30e9\u30b9\u300d\u306e\u7ae0\u3067\u3001\u6587\u5b57\u5217\u3060\u3051\u3092\u5f15\u6570\u3067\u6e21\u3057\u305f\u5834\u5408\u306b\u3082\u3001\u6587\u5b57\u5217\u3068\u6570\u5b57\u3092\u5f15\u6570\u3067\u6e21\u3057\u305f\u5834\u5408\u306b\u3082indexOf\u30e1\u30bd\u30c3\u30c9\u3092\u5229\u7528\u3067\u304d\u305f\u306e\u306f\u3001\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3092\u7528\u3044\u3066\u3044\u305f\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u3055\u3066\u3001\u305d\u308c\u3067\u306f\u5b9f\u969b\u306b\u3001\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3092\u8a18\u8ff0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u4ee5\u4e0b\u304c\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3067\u3059\u3002<br \/>\nMyClass1\u30af\u30e9\u30b9\u306e\u4e2d\u306b\u3001\u5f15\u6570\u306e\u6570\u3001\u578b\u306e\u7570\u306a\u308bmyTemp\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u304c3\u3064\u5b9a\u7fa9\u3057\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"Pre-title\">MyClass1.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MyClass1 {\r\n\t\/\/\u5f15\u6570\u306e\u7121\u3044 myTemp \u30e1\u30bd\u30c3\u30c9\r\n\tvoid myTemp() {\r\n\t\tSystem.out.println(10);\r\n\t}\r\n\t\/\/int \u578b\u306e\u5f15\u6570\u3092\u6301\u3064 myTemp \u30e1\u30bd\u30c3\u30c9\r\n\tvoid myTemp(int x) {\r\n\t\tSystem.out.println(x);\r\n\t}\r\n\t\/\/ long \u578b\u306e\u5f15\u6570\u3092\u6301\u3064 myTemp \u30e1\u30bd\u30c3\u30c9\r\n\tvoid myTemp(long x) {\r\n\t\tSystem.out.println(x);\r\n\t}\r\n}<\/code><\/pre>\n<p>\u547c\u3073\u51fa\u3057\u5074\u3067\u306f\u3001\u5f15\u6570\u306e\u578b\u3092\u5909\u66f4\u3059\u308c\u3070\u3001\u540c\u3058\u578b\u3092\u6301\u3063\u305f\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u307e\u3059\u3002<\/p>\n<div class=\"Pre-title\">MainClass1.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MainClass1 {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tMyClass1 m = new MyClass1();\r\n\r\n\t\t\/\/ \u5f15\u6570\u7121\u3057\u306e myTemp \u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u307e\u3059\r\n\t\tm.myTemp();\r\n\r\n\t\t\/\/ int \u578b\u306e\u5f15\u6570\u3092\u6301\u3064 myTemp \u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u307e\u3059\r\n\t\tm.myTemp(38);\r\n\r\n\t\t\/\/ long \u578b\u306e\u5f15\u6570\u3092\u6301\u3064 myTemp \u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u307e\u3059\r\n\t\tm.myTemp(2147483648L);\r\n\t}\r\n}<\/code><\/pre>\n<p><a class=\"Ext Image-link\" href=\"https:\/\/techfun.cc\/wp-content\/uploads\/2024\/06\/overload1.png\"><br \/>\n\t<img decoding=\"async\" src=\"https:\/\/techfun.cc\/wp-content\/uploads\/2024\/06\/overload1.png\" alt=\"overload1\"><br \/>\n<\/a><\/p>\n<p>\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u306f\u3001\u5f15\u6570\u306e\u6570\u3068\u578b\u3092\u540c\u3058\u306b\u3059\u308b\u3068\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306f\u3001\u30e1\u30bd\u30c3\u30c9\u540d\u3082\u5f15\u6570\u306e\u578b\u3082\u6570\u3082\u540c\u3058\u306b\u3059\u308b\u3068\u3001\u5229\u7528\u3059\u308b\u30af\u30e9\u30b9\u3067\u3001\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u6642\u306b\u3069\u3061\u3089\u3092\u5b9f\u884c\u3057\u3066\u3088\u3044\u304b\u5206\u304b\u3089\u306a\u304f\u306a\u308b\u304b\u3089\u3067\u3059\u3002<br \/>\n\u307e\u305f\u3001\u623b\u308a\u5024\u306e\u307f\u9055\u3046\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30b7\u30b0\u30cd\u30c1\u30e3\u304c\u540c\u4e00\u3068\u307f\u306a\u3055\u308c\u308b\u305f\u3081\u3001\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3067\u304d\u307e\u305b\u3093\u306e\u3067\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MyClass2 {\r\n\t\/\/\u5f15\u6570\u306e\u7121\u3044 myTemp \u30e1\u30bd\u30c3\u30c9\r\n\tvoid myTemp() {\r\n\t}\r\n\r\n\t\/\/\u623b\u308a\u5024\u306e\u307f\u9055\u3046\u30e1\u30bd\u30c3\u30c9\u306f\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3067\u304d\u306a\u3044\u305f\u3081\u30a8\u30e9\u30fc\uff01\r\n\tint myTemp() {\r\n\t\treturn 10;\r\n\t}\r\n}<\/code><\/pre>\n<p>\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3092\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\n\u8907\u6570\u306e\u5f15\u6570\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u5229\u7528\u3059\u308b\u5074\u306b\u3068\u3063\u3066\u3001\u5229\u7528\u306e\u81ea\u7531\u5ea6\u304c\u3042\u304c\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u304c\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3067\u3059\u3002<\/p>\n<div class=\"Pre-title\">MyClass3.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MyClass3 {\r\n\t\/\/ int\u578b\u306e\u5909\u6570x\u3092\u5b9a\u7fa9\r\n\tint x;\r\n\r\n\t\/\/ \u5f15\u6570\u306e\u7121\u3044\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\r\n\tMyClass3() {\r\n\t\t\/\/ \u5909\u6570x\u309210\u3067\u521d\u671f\u5316\r\n\t\tx = 10;\r\n\t}\r\n\r\n\t\/\/ int\u578b\u306e\u5f15\u6570\u3092\u6301\u3064\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\r\n\tMyClass3(int i) {\r\n\t\t\/\/ \u5909\u6570x\u3092\u5f15\u6570\u3067\u521d\u671f\u5316\r\n\t\tx = i;\r\n\t}\r\n}<\/code><\/pre>\n<p>\u30b9\u30fc\u30d1\u30fc\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u304c\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3067\u3059\u3002<\/p>\n<div class=\"Pre-title\">MySuper1.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MySuper1 {\r\n\t\/\/ MySuper1\u30af\u30e9\u30b9\u306e\u5f15\u6570\u306e\u7121\u3044myTemp\u30e1\u30bd\u30c3\u30c9\r\n\tvoid myTemp() {\r\n\t}\r\n}<\/code><\/pre>\n<div class=\"Pre-title\">MySub1.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MySub1 extends MySuper1 {\r\n\t\/\/ MySub1\u30af\u30e9\u30b9\u306eint\u578b\u306e\u5f15\u6570\u3092\u6301\u3064myTemp\u30e1\u30bd\u30c3\u30c9\r\n\tvoid myTemp(int x) {\r\n\t}\r\n}<\/code><\/pre>\n<p>\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u5f15\u6570\u306f\u9055\u3063\u3066\u3082\u540c\u3058\u6a5f\u80fd\u3092\u6301\u3063\u305f\u51e6\u7406\u306e\u5834\u5408\u3001\u540c\u3058\u540d\u524d\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u3057\u305f\u65b9\u304c\u30d7\u30ed\u30b0\u30e9\u30e0\u30bd\u30fc\u30b9\u304c\u5206\u304b\u308a\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306e\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u306e\u5834\u5408\u3001\u521d\u671f\u5024\u306e\u5f15\u6e21\u3057\u65b9\u3092\u8272\u3005\u306a\u30d1\u30bf\u30fc\u30f3\u3067\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u5229\u7528\u3059\u308b\u30af\u30e9\u30b9\u306b\u3068\u3063\u3066\u3001\u5229\u7528\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<div class=\"Separator\">\n<div class=\"Separator__child\"><\/div>\n<\/div>\n<h3 class=\"Heading Title Title--m\" id=\"Bookmark-5\"><span class=\"Num\">5.<\/span>\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9<\/h3>\n<p>\u6b21\u306b<span class=\"Text-highlight\">\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9<\/span>\u306b\u3064\u3044\u3066\u5b66\u7fd2\u3057\u307e\u3059\u3002<br \/>\n\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3068\u306f\u89aa\u30af\u30e9\u30b9\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e1\u30bd\u30c3\u30c9\u3092\u3001\u7d99\u627f\u3057\u305f\u5b50\u30af\u30e9\u30b9\u3067\u518d\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3092\u8a00\u3044\u307e\u3059\u3002<br \/>\n\u3064\u307e\u308a\u3001\u89aa\u30af\u30e9\u30b9\u304b\u3089\u7d99\u627f\u3057\u305f\u30e1\u30bd\u30c3\u30c9\u306e\u51e6\u7406\u5185\u5bb9\u3092\u5b50\u30af\u30e9\u30b9\u5074\u3067\u66f8\u304d\u63db\u3048\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u305d\u306e\u969b\u3001\u89aa\u30af\u30e9\u30b9\u306e\u5143\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u5909\u66f4\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u4ee5\u4e0b\u304c\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3067\u3059\u3002\u89aa\u30af\u30e9\u30b9\u306eMySuper2\u306b\u5b9a\u7fa9\u3055\u308c\u305fmyTemp\u30e1\u30bd\u30c3\u30c9\u3092\u3001\u5b50\u30af\u30e9\u30b9\u306eMySub2\u3067\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u901a\u5e38\u3001\u89aa\u30af\u30e9\u30b9\u306emyTemp\u30e1\u30bd\u30c3\u30c9\u306e\u51e6\u7406\u3068\u306f\u7570\u306a\u308b\u51e6\u7406\u304c\u5b50\u30af\u30e9\u30b9\u3067\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3055\u308c\u305fmyTemp\u30e1\u30bd\u30c3\u30c9\u306b\u8a18\u8ff0\u3055\u308c\u307e\u3059\u3002<\/p>\n<div class=\"Pre-title\">MySuper2.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MySuper2 {\r\n\t\/\/ MySuper2\u30af\u30e9\u30b9\u306emyTemp\u30e1\u30bd\u30c3\u30c9\r\n\tvoid myTemp() {\r\n\t\tSystem.out.println(10);\r\n\t}\r\n}<\/code><\/pre>\n<div class=\"Pre-title\">MySub2.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MySub2 extends MySuper2 {\r\n\t\/\/ \u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3055\u308c\u305fmyTemp\u30e1\u30bd\u30c3\u30c9\r\n\tvoid myTemp() {\r\n\t\tSystem.out.println(20);\r\n\t}\r\n}<\/code><\/pre>\n<p><a class=\"Ext Image-link\" href=\"https:\/\/techfun.cc\/wp-content\/uploads\/2024\/06\/override2.png\"><br \/>\n\t<img decoding=\"async\" src=\"https:\/\/techfun.cc\/wp-content\/uploads\/2024\/06\/override2.png\" alt=\"override2\"><br \/>\n<\/a><\/p>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-5-1\"><span class=\"Num\">5.1.<\/span>\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3068\u30a2\u30af\u30bb\u30b9\u4fee\u98fe\u5b50<\/h4>\n<p>\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u304c\u9069\u7528\u3055\u308c\u308b\u306e\u306f\u3001private\u4ee5\u5916\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<br \/>\nprivate\u306f\u3001\u5b9a\u7fa9\u3055\u308c\u305f\u30af\u30e9\u30b9\u306e\u307f\u3067\u53c2\u7167\u53ef\u80fd\u306a\u305f\u3081\u3001\u5b50\u30af\u30e9\u30b9\u3067\u306f\u3001\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u307e\u305f\u3001\u89aa\u30af\u30e9\u30b9\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308bstatic\u4fee\u98fe\u5b50\u304c\u4ed8\u52a0\u3055\u308c\u305f\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u3068\u30af\u30e9\u30b9\u5909\u6570\u3092\u5b50\u30af\u30e9\u30b9\u3067\u518d\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306f\u96a0\u853d\u3068\u8a00\u308f\u308c\u3001\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3068\u306f\u5225\u306b\u6271\u308f\u308c\u307e\u3059\u3002<br \/>\n\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3068\u304d\u306b\u6307\u5b9a\u3067\u304d\u308b\u30a2\u30af\u30bb\u30b9\u4fee\u98fe\u5b50\u306f\u3001\u30a2\u30af\u30bb\u30b9\u5236\u9650\u304c\u89aa\u30af\u30e9\u30b9\u3068\u540c\u3058\u304b\u3001\u3086\u308b\u304f\u306a\u308b\u69d8\u306b\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u7d99\u627f\u3055\u308c\u308b\u89aa\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u3001public\u306e\u5834\u5408\u306b\u306fpublic\u306e\u307f\u3001protected\u306e\u5834\u5408\u306b\u306fpublic\u304bprotected\u306e\u307f\u304c\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u305f\u30e1\u30bd\u30c3\u30c9\u306b\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-5-2\"><span class=\"Num\">5.2.<\/span>\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u306e\u305d\u306e\u4ed6\u306e\u30eb\u30fc\u30eb<\/h4>\n<p>\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u306b\u306f\u3001\u4e0a\u8a18\u306e\u307b\u304b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30eb\u30fc\u30eb\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul class=\"Base-list Base-list--nodot\">\n<li class=\"Base-list__child\">\n<div class=\"List-num\">1.<\/div>\n<div class=\"List-block\">\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u306f\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e1\u30bd\u30c3\u30c9\u540d\u3001\u5f15\u6570\u3001\u623b\u308a\u5024\u306e\u578b\u304c\u540c\u3058\u3067\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002<\/div>\n<\/li>\n<li class=\"Base-list__child\">\n<div class=\"List-num\">2.<\/div>\n<div class=\"List-block\">final\u4fee\u98fe\u5b50\u304c\u4ed8\u4e0e\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/div>\n<\/li>\n<li class=\"Base-list__child\">\n<div class=\"List-num\">3.<\/div>\n<div class=\"List-block\">abstract\u4fee\u98fe\u5b50\u304c\u4ed8\u4e0e\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u5b50\u30af\u30e9\u30b9\u3067\u5fc5\u305a\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002<br \/>\n\t\t\t\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u306a\u3044\u5834\u5408\u306f\u305d\u306e\u5b50\u30af\u30e9\u30b9\u5168\u4f53\u304cabstract\u30af\u30e9\u30b9\u306b\u306a\u308a\u307e\u3059\u3002<\/div>\n<\/li>\n<li class=\"Base-list__child\">\n<div class=\"List-num\">4.<\/div>\n<div class=\"List-block\">\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3055\u308c\u308b\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u4ed8\u4e0e\u3055\u308c\u305fthrows\u7bc0\u4ee5\u5916\u306e\u4f8b\u5916\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u5074\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e1\u30bd\u30c3\u30c9\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\t\t\t\u305f\u3060\u3057\u3001\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3055\u308c\u308b\u30af\u30e9\u30b9\u306b\u6307\u5b9a\u3055\u308c\u305f\u4f8b\u5916\u3088\u308a\u9650\u5b9a\u3059\u308b\u4f8b\u5916\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u30af\u30e9\u30b9\u306b\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306f\u53ef\u80fd\u3067\u3059\u3002<\/div>\n<\/li>\n<\/ul>\n<div class=\"Separator\">\n<div class=\"Separator__child\"><\/div>\n<\/div>\n<h3 class=\"Heading Title Title--m\" id=\"Bookmark-6\"><span class=\"Num\">6.<\/span>\u62bd\u8c61\u30af\u30e9\u30b9<\/h3>\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u3067\u306f\u3001\u30af\u30e9\u30b9\u3092\u8a2d\u8a08\u3059\u308b\u3068\u304d\u306b\u62bd\u8c61\u7684\uff08\u6c4e\u7528\u7684\uff09\u306a\u89aa\u30af\u30e9\u30b9\u304b\u3089\u5b50\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u81ea\u7136\u306a\u65b9\u6cd5\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u62bd\u8c61\u30af\u30e9\u30b9\u306f\u3001\u300c\u5171\u901a\u306e\u6a5f\u80fd\u3092\u6301\u3064\u30af\u30e9\u30b9\u3092\u5206\u985e\u3057\u3001\u305d\u306e\u5171\u901a\u306e\u6a5f\u80fd\u306e\u5b9a\u7fa9\u3092\u8a18\u8ff0\u3057\u3001\u5b50\u30af\u30e9\u30b9\u306e\u8a18\u8ff0\u3092\u7c21\u7565\u5316\u3059\u308b\u3053\u3068\u300d\u304c\u76ee\u7684\u3067\u3059\u3002<\/p>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-6-1\"><span class=\"Num\">6.1.<\/span>\u62bd\u8c61\u30af\u30e9\u30b9\u3068\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9<\/h4>\n<p>\u62bd\u8c61\u30af\u30e9\u30b9\u306b\u306f\u3001abstract\u4fee\u98fe\u5b50\u3092\u30af\u30e9\u30b9\u306e\u524d\u306b\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u307e\u305f\u3001abstract\u4fee\u98fe\u5b50\u3092\u524d\u306b\u3064\u3051\u305f\u30e1\u30bd\u30c3\u30c9\u3092\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3068\u547c\u3073\u307e\u3059\u3002<br \/>\n\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u306f\u3001abstract\u4fee\u98fe\u5b50\u3092\u3064\u3051\u3001\u300c\u540d\u524d\u3068\u578b\u3060\u3051\u306e\u30e1\u30bd\u30c3\u30c9\u300d\u3067\u5ba3\u8a00\u3057\u307e\u3059\u3002\u3053\u306e\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3092\u542b\u3080\u30af\u30e9\u30b9\u304c\u62bd\u8c61\u30af\u30e9\u30b9\u3068\u547c\u3070\u308c\u3001\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3092\u4e00\u3064\u3067\u3082\u6301\u3064\u30af\u30e9\u30b9\u306f\u3001\u5fc5\u305aabstract\u3067\u30af\u30e9\u30b9\u5ba3\u8a00\u3092\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>\u4ee5\u4e0b\u304c\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3067\u3059\u3002\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u901a\u5e38\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u5b9a\u7fa9\u304b\u3089\u300c{}\u300d\uff08\u4e2d\u62ec\u5f27\uff09\u306e\u90e8\u5206\u3092\u53d6\u308a\u9664\u304d\u3001\u300c;\u300d\uff08\u30bb\u30df\u30b3\u30ed\u30f3\uff09\u3067\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n<div class=\"Pre-title\">MyAbstractClass.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public abstract class MyAbstractClass {\r\n\tabstract void myTemp();\r\n\tabstract void myTemp(int x);\r\n}<\/code><\/pre>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-6-2\"><span class=\"Num\">6.2.<\/span>\u62bd\u8c61\u30af\u30e9\u30b9\u3068\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u306e\u5229\u7528\u65b9\u6cd5<\/h4>\n<p>\u62bd\u8c61\u30af\u30e9\u30b9\u306f\u3001\u30e1\u30bd\u30c3\u30c9\u304c\u4e2d\u9014\u534a\u7aef\u306a\u72b6\u614b\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3092\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u3082\u3057\u3001\u300cnew MyAbstractClass()\u300d\u3068\u8a18\u8ff0\u3059\u308c\u3070\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3082\u76f4\u63a5\u5229\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u62bd\u8c61\u30af\u30e9\u30b9\u306f\u3001\u7d99\u627f\u5c02\u7528\u306e\u30af\u30e9\u30b9\u3068\u3057\u3066\u5229\u7528\u3055\u308c\u307e\u3059\u3002\u5b50\u30af\u30e9\u30b9\u306b\u7d99\u627f\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u306e\u51e6\u7406\u306e\u90e8\u5206\u306f\u3001\u5b50\u30af\u30e9\u30b9\u3067\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u304c\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3067\u3059\u3002\u4e0a\u8a18\u306e\u62bd\u8c61\u30af\u30e9\u30b9\u3067\u3042\u308bMyAbstractClass\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u3001\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3066\u51e6\u7406\u5185\u5bb9\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"Pre-title\">MyClass4.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MyClass4 extends MyAbstractClass {\r\n\tvoid myTemp() {\r\n\t\tSystem.out.println(\"\u304a\u306f\u3088\u3046\u3054\u3056\u3044\u307e\u3059\");\r\n\t}\r\n\tvoid myTemp(int x) {\r\n\t\tSystem.out.println(\"\u4eca\u65e5\u306f\u3001\" + x + \"\u65e5\u3067\u3059\");\r\n\t}\r\n}<\/code><\/pre>\n<div class=\"Pre-title\">MyClass5.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MyClass5 extends MyAbstractClass {\r\n\tvoid myTemp() {\r\n\t\tSystem.out.println(\"\u3053\u3093\u306b\u3061\u306f\");\r\n\t}\r\n\tvoid myTemp(int x) {\r\n\t\tSystem.out.println(\"\u4eca\u3001\" + x +  \"\u6642\u3067\u3059\");\r\n\t}\r\n}<\/code><\/pre>\n<p>\u62bd\u8c61\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u3067\u3001\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3066\u3044\u306a\u3044\u3068\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u306f\u3001\u5fc5\u305a\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u4e0a\u8a18\u306e2\u3064\u306e\u5b50\u30af\u30e9\u30b9\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"Pre-title\">MainClass3.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MainClass3 {\r\n\r\n\tpublic static void main(String[] args){\r\n\t\tMyClass4 my4 = new MyClass4();\r\n\t\tmy4.myTemp();\r\n\t\tmy4.myTemp(20);\r\n\r\n\t\tMyClass5 my5 = new MyClass5();\r\n\t\tmy5.myTemp();\r\n\t\tmy5.myTemp(20);\r\n\t}\r\n}<\/code><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u540c\u3058\u3088\u3046\u306a\u51e6\u7406\u3092\u6301\u3064MyClass4\u30af\u30e9\u30b9\u3068MyClass5\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u5834\u5408\u3001\u5171\u901a\u7684\u306a\u51e6\u7406\u306e\u90e8\u5206\u3092\u62bd\u8c61\u30af\u30e9\u30b9\u3067\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u5b50\u30af\u30e9\u30b9\u306e\u8a18\u8ff0\u306e\u7c21\u7565\u5316\u3084\u4ed5\u69d8\u306e\u7d71\u4e00\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"Separator\">\n<div class=\"Separator__child\"><\/div>\n<\/div>\n<h3 class=\"Heading Title Title--m\" id=\"Bookmark-7\"><span class=\"Num\">7.<\/span>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9<\/h3>\n<p>\u6700\u5f8c\u306f\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u3059\u3002<br \/>\n\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306f\u3001\u62bd\u8c61\u30af\u30e9\u30b9\u3068\u540c\u69d8\u306e\u6a5f\u80fd\u3092\u6301\u3061\u3001\u62bd\u8c61\u30af\u30e9\u30b9\u3092\u5b8c\u5168\u306b\u62bd\u8c61\u5316\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30af\u30e9\u30b9\u306e\u5b9a\u7fa9\u306b\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u300cclass\u300d\u3067\u306f\u306a\u304f\u3001\u300cinterface\u300d\u3067\u5ba3\u8a00\u3057\u307e\u3059\u3002<br \/>\n\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u3001\u30af\u30e9\u30b9\u3068\u540c\u69d8\u306b\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u304c\u3001\u300cpublic static final\u300d\u4fee\u98fe\u5b50\u304c\u81ea\u52d5\u7684\u306b\u4ed8\u52a0\u3055\u308c\u308b\u305f\u3081\u3001\u5fc5\u305a\u5b9a\u6570\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u306e\u307f\u5b9a\u7fa9\u3067\u304d\u3001abstract\u4fee\u98fe\u5b50\u306f\u7701\u7565\u3067\u304d\u307e\u3059\u304c\u3001\u7701\u7565\u3057\u3066\u3082\u3001\u300cpublic abstract\u300d\u4fee\u98fe\u5b50\u304c\u81ea\u52d5\u7684\u306b\u4ed8\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u304c\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3067\u3059\u3002<\/p>\n<div class=\"Pre-title\">MyInterface1.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public interface MyInterface1 {\r\n\t\/\/ \u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u4fee\u98fe\u5b50\u306f\u4ed8\u3051\u306a\u304f\u3066\u3082\u5b9a\u6570\u306b\u306a\u308a\u307e\u3059\uff09\r\n\t\/\/ \u81ea\u52d5\u7684\u306b\u300cpublic static final\u300d\u4fee\u98fe\u5b50\u304c\u4ed8\u52a0\u3055\u308c\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u8a18\u8ff0\u3067\u3082\u3001\u300cpublic static final int a = 10;\u300d\u3068\u540c\u7fa9\u3068\u306a\u308a\u307e\u3059\u3002\r\n\tint a = 10;\r\n\r\n\t\/\/ \u30e1\u30bd\u30c3\u30c9\uff08abstract \u304c\u7121\u304f\u3066\u3082\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u306b\u306a\u308a\u307e\u3059\uff09\r\n\t\/\/ \u81ea\u52d5\u7684\u306b\u300cpublic abstract\u300d\u4fee\u98fe\u5b50\u304c\u4ed8\u52a0\u3055\u308c\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u8a18\u8ff0\u3067\u3082\u3001\u300cpublic abstract void myTemp();\u300d\u3068\u540c\u7fa9\u3068\u306a\u308a\u307e\u3059\u3002\r\n\tvoid myTemp();\r\n}<\/code><\/pre>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-7-1\"><span class=\"Num\">7.1.<\/span>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5229\u7528\u65b9\u6cd5<\/h4>\n<p>\u305d\u308c\u3067\u306f\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5229\u7528\u65b9\u6cd5\u3092\u5b66\u7fd2\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306f\u3001\u62bd\u8c61\u30af\u30e9\u30b9\u3068\u540c\u69d8\u306b\u305d\u306e\u307e\u307e\u76f4\u63a5\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u5b9a\u7fa9\u3057\u3066\u3042\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u3084\u30e1\u30bd\u30c3\u30c9\u3092\u4ed6\u306e\u30af\u30e9\u30b9\u306b\u5f15\u304d\u7d99\u3044\u3067\u3082\u3089\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5143\u306b\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3092\u300c\u5b9f\u88c5\u3059\u308b\u300d\u3068\u8a00\u3044\u307e\u3059\u3002\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3059\u308b\u30af\u30e9\u30b9\u306f\u3001\u300cimplements\u300d\u3092\u4f7f\u3063\u3066\u3001\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u304c\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3067\u3059\u3002MyInterface1\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092implements\u3057\u3066\u3001MyClassImpl\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n10\u306e\u5024\u3092\u6301\u3064int\u578b\u306e\u5b9a\u6570a\u306f\u3001\u305d\u306e\u307e\u307e\u5f15\u304d\u7d99\u304c\u308c\u307e\u3059\u3002\u307e\u305f\u3001\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u306emyTemp\u306f\u3001\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3059\u308b\u3068\u304d\u306bpublic\u3092\u4ed8\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"Pre-title\">MyClassImpl.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MyClassImpl implements MyInterface1 {\r\n\t\/\/ MyInterface1\u3067\u5ba3\u8a00\u3055\u308c\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u518d\u5b9a\u7fa9\r\n\tpublic void myTemp() {\r\n\t\tSystem.out.println(a); \/\/ \u5b9a\u6570a\u306e\u5024\u3092\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u51fa\u529b\r\n\t}\r\n}<\/code><\/pre>\n<p>\u6700\u5f8c\u306b\u3053\u308c\u3092\u5229\u7528\u3059\u308b\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"Pre-title\">MainClass4.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MainClass4 {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tMyClassImpl myImpl = new MyClassImpl();\r\n\t\tmyImpl.myTemp();\r\n\r\n\t}\r\n}<\/code><\/pre>\n<p><a class=\"Ext Image-link\" href=\"https:\/\/techfun.cc\/wp-content\/uploads\/2024\/06\/interface1.png\"><br \/>\n\t<img decoding=\"async\" src=\"https:\/\/techfun.cc\/wp-content\/uploads\/2024\/06\/interface1.png\" alt=\"interface1\"><br \/>\n<\/a><\/p>\n<p>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306f\u3001\u7d99\u627f\u3068\u9055\u3063\u3066\u8907\u6570\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u30af\u30e9\u30b9\u306f\u591a\u91cd\u7d99\u627f\u304c\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u3042\u308c\u3070\u3001implements\u3059\u308b\u30af\u30e9\u30b9\u3067\u30e1\u30bd\u30c3\u30c9\u306e\u51e6\u7406\u3092\u8a18\u8ff0\u3059\u308b\u305f\u3081\u3001\u4f55\u3092\u5f15\u304d\u7d99\u3044\u3067\u3044\u308b\u306e\u304b\u5206\u304b\u3089\u306a\u304f\u306a\u3089\u306a\u3044\u306e\u3067\u3001\u8907\u6570\u5b9f\u88c5\u3092\u53ef\u80fd\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"Copy prettyprint lang-js\"><code>public class SubClass implements MyInterface1, MyInterface2,\u30fb\u30fb\u30fb {\r\n\t\/\/ MyInterface1\u3068MyInterface2\u3068\u30fb\u30fb\u30fb\u3067\u5ba3\u8a00\u3055\u308c\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u518d\u5b9a\u7fa9\r\n}<\/code><\/pre>\n<p>\u4f8b\u3048\u3070\u4e8c\u3064\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div class=\"Pre-title\">MyInterface2.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public interface MyInterface2 {\r\n\t\/\/ \u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u4fee\u98fe\u5b50\u306f\u4ed8\u3051\u306a\u304f\u3066\u3082\u5b9a\u6570\u306b\u306a\u308a\u307e\u3059\uff09\r\n\tint b = 30;\r\n\r\n\t\/\/ \u30e1\u30bd\u30c3\u30c9\uff08abstract \u304c\u7121\u304f\u3066\u3082\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u306b\u306a\u308a\u307e\u3059\uff09\r\n\tvoid myTemp2();\r\n}<\/code><\/pre>\n<div class=\"Pre-title\">MyClassDoubleImpl.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MyClassDoubleImpl implements MyInterface1, MyInterface2 {\r\n\t\/\/ MyInterface1\u3067\u5ba3\u8a00\u3055\u308c\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u518d\u5b9a\u7fa9\r\n\tpublic void myTemp() {\r\n\t\t\/\/ \u5b9a\u6570a\u306e\u5024\u3092\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u51fa\u529b\r\n\t\tSystem.out.println(a);\r\n\t}\r\n\r\n\t\/\/ MyInterface2\u3067\u5ba3\u8a00\u3055\u308c\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u518d\u5b9a\u7fa9\r\n\tpublic void myTemp2() {\r\n\t\t\/\/ \u5b9a\u6570b\u306e\u5024\u3092\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u51fa\u529b\r\n\t\tSystem.out.println(b);\r\n\t}\r\n}<\/code><\/pre>\n<p>\u591a\u6570\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u5834\u5408\u306e\u6982\u5ff5\u56f3\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a class=\"Ext Image-link\" href=\"https:\/\/techfun.cc\/wp-content\/uploads\/2024\/06\/interface2.png\"><br \/>\n\t<img decoding=\"async\" src=\"https:\/\/techfun.cc\/wp-content\/uploads\/2024\/06\/interface2.png\" alt=\"interface2\"><br \/>\n<\/a><\/p>\n<p>\u307e\u305f\u3001\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"Copy prettyprint lang-js\"><code>public class SubClass extends MyExtends implements MyInterface {\r\n\t\/\/ MyInterface\u3067\u5ba3\u8a00\u3055\u308c\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u518d\u5b9a\u7fa9\r\n}<\/code><\/pre>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-7-2\"><span class=\"Num\">7.2.<\/span>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u578b\u306e\u53c2\u7167\u5909\u6570<\/h4>\n<p>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u30af\u30e9\u30b9\u306f\u3001\u305d\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u578b\u3092\u6301\u3063\u305f\u53c2\u7167\u5909\u6570\u306b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4ee3\u5165\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u304c\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3067\u3059\u3002MyInterface3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092implements\u3057\u305fMyClassImpl2\u30af\u30e9\u30b9\u3092\u5229\u7528\u3059\u308b\u3068\u304d\u306b\u3001MyInterface3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u578b\u306e\u53c2\u7167\u5909\u6570m\u306b\u3001MyClassImpl2\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"Pre-title\">MyInterface3.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public interface MyInterface3 {\r\n\tvoid myTemp();\r\n}<\/code><\/pre>\n<div class=\"Pre-title\">MyClassImpl2.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MyClassImpl2 implements MyInterface3 {\r\n\tpublic void myTemp() {\r\n\t\tSystem.out.println(\"MyInterface3\u306emyTemp\u30e1\u30bd\u30c3\u30c9\u5b9f\u88c5\");\r\n\t}\r\n}<\/code><\/pre>\n<div class=\"Pre-title\">MainClass5.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class MainClass5 {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tMyInterface3 m = new MyClassImpl2();\r\n\t\tm.myTemp();\r\n\r\n\t}\r\n}<\/code><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u540c\u3058\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u6301\u3063\u305f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5834\u5408\u3001\u540c\u3058\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u578b\u306e\u53c2\u7167\u5909\u6570\u306b\u4ee3\u5165\u3067\u304d\u307e\u3059\u3002<br \/>\n\u3064\u307e\u308a\u3001\u30af\u30e9\u30b9\u304c\u9055\u3063\u3066\u3044\u3066\u3082\u540c\u3058\u30b3\u30fc\u30c9\u3067\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u305b\u3001\u540c\u3058\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092implements\u3057\u305f\u4ed6\u30af\u30e9\u30b9\u306b\u5909\u66f4\u3057\u305f\u5834\u5408\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u90e8\u5206\uff08new\u306e\u5f8c\u306e\u30af\u30e9\u30b9\u540d\uff09\u3092\u4fee\u6b63\u3059\u308b\u306e\u307f\u3067\u6e08\u307f\u307e\u3059\u3002<\/p>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-7-3\"><span class=\"Num\">7.3.<\/span>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u7d99\u627f<\/h4>\n<p>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u7d99\u627f\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u304c\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3067\u3059\u3002<\/p>\n<pre class=\"Copy prettyprint lang-js\"><code>public interface MyInterface4 {\r\n\tvoid myTemp();\r\n}<\/code><\/pre>\n<pre class=\"Copy prettyprint lang-js\"><code>public interface MyInterface5 extends MyInterface4 {\r\n}<\/code><\/pre>\n<p>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5b66\u7fd2\u306f\u3001\u4ee5\u4e0a\u3067\u3059\u3002<br \/>\n\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306f\u3001\u5b9f\u969b\u306b\u6d3b\u7528\u3059\u308b\u306b\u306f\u5c11\u3057\u96e3\u3057\u3044\u6a5f\u80fd\u3067\u3059\u3002<br \/>\n\u9593\u9055\u3063\u305f\u4f7f\u3044\u65b9\u3092\u3059\u308b\u3068\u5206\u304b\u308a\u306b\u304f\u3044\u30bd\u30fc\u30b9\u306b\u306a\u308b\u305f\u3081\u3001\u57fa\u672c\u7684\u306a\u8003\u3048\u65b9\u3092\u3057\u3063\u304b\u308a\u7406\u89e3\u3057\u3066\u304b\u3089\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"Separator\">\n<div class=\"Separator__child\"><\/div>\n<\/div>\n<h3 class=\"Heading Title Title--m\" id=\"Bookmark-8\"><span class=\"Num\">8.<\/span>\u7df4\u7fd2\u554f\u984c1<\/h3>\n<p>\u305d\u308c\u3067\u306f\u3001\u30dd\u30ea\u30e2\u30d5\u30a3\u30ba\u30e0\u306e\u5404\u624b\u6cd5\u306e\u7df4\u7fd2\u554f\u984c\u3067\u3059\u3002\u300c\u30a4\u30f3\u30d8\u30ea\u30bf\u30f3\u30b9\u300d\u306e\u7ae0\u3067\u4f5c\u6210\u3057\u305fpetpac\u30d1\u30c3\u30b1\u30fc\u30b8\u3068Pet\u30af\u30e9\u30b9\u3001\u305d\u308c\u3068Cat\u30af\u30e9\u30b9\u3068Dog\u30af\u30e9\u30b9\u3092\u5229\u7528\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-8-1\"><span class=\"Num\">8.1.<\/span>\u554f\u984c1<\/h4>\n<p>petpac\u30d1\u30c3\u30b1\u30fc\u30b8\u306bPetInterface\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u4ee5\u4e0b\u306e\u5185\u5bb9\u3067\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<table class=\"Base-table\">\n<colgroup>\n<col>\n<col>\n\t<\/colgroup>\n<tbody>\n<tr>\n<th>\n\t\t\t\t\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\n\t\t\t<\/th>\n<td>\n\t\t\t\tpetpac\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<th>\n\t\t\t\t\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u540d\n\t\t\t<\/th>\n<td>\n\t\t\t\tPetInterface\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<th rowspan=\"2\">\n\t\t\t\t\u30e1\u30bd\u30c3\u30c9\n\t\t\t<\/th>\n<td>\n\t\t\t\tvoid eat()\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tvoid play()\n\t\t\t<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"Answer-block\">\n\t<input class=\"SW\" type=\"checkbox\" id=\"Answer-content-1\"><label for=\"Answer-content-1\" class=\"Answer-SW\"><span\n\t\t\tclass=\"Google-icon Google-icon--arrow-single-gray\"><\/span>\u89e3\u7b54\u3092\u8868\u793a\u3059\u308b<\/label><\/p>\n<div class=\"Answer-content\">\n<pre class=\"Copy prettyprint lang-js\"><code>package petpac;\r\n\r\npublic interface PetInterface {\r\n\r\n\t\/\/ eat\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\r\n\tvoid eat();\r\n\r\n\t\/\/ play\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\r\n\tvoid play();\r\n}<\/code><\/pre>\n<p>\t\t\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5b9a\u7fa9\u306f\u3001\u300cpublic interface \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u540d\u300d\u3067\u59cb\u307e\u308a\u307e\u3059\u3002<br \/>\n\t\t\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u5b9a\u7fa9\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u306e\u3067\u3001\u51e6\u7406\u306f\u8a18\u8ff0\u3057\u307e\u305b\u3093\u3002<br \/>\n\t\t\u623b\u308a\u5024\u306e\u578b\u3068\u30e1\u30bd\u30c3\u30c9\u540d\u3001\u5f15\u6570\u306e\u307f\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<br \/>\n\t\t\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u901a\u5e38\u300cpublic abstract void eat();\u300d\u3068\u3044\u3046\u3088\u3046\u306b\u3001\u6700\u521d\u306b\u300cpublic<br \/>\n\t\tabstract\u300d\u3092\u4ed8\u3051\u307e\u3059\u304c\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u5b9a\u7fa9\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u306f\u5168\u3066\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u306e\u3067\u3001\u300cpublic abstract\u300d\u3092\u7701\u7565\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\n\t<\/p><\/div>\n<\/div>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-8-2\"><span class=\"Num\">8.2.<\/span>\u554f\u984c2<\/h4>\n<p>Pet\u30af\u30e9\u30b9\u306b\u554f\u984c1\u306ePetInterface\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092implements\u3057\u3066\u3001\u5404\u30e1\u30bd\u30c3\u30c9\u3092\u4ee5\u4e0b\u306e\u5185\u5bb9\u3067\u5b9f\u88c5\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u5b9f\u88c5\u5f8c\u3001ImplPetShop\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3001\u5b9f\u884c\u7d50\u679c\u306e\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<table class=\"Base-table\">\n<colgroup>\n<col>\n<col>\n<col>\n\t<\/colgroup>\n<tbody>\n<tr>\n<th rowspan=\"2\">\n\t\t\t\t\u30e1\u30bd\u30c3\u30c9\n\t\t\t<\/th>\n<td>\n\t\t\t\tvoid eat()\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u300c\u3054\u306f\u3093\u3092\u98df\u3079\u307e\u3057\u305f\u3002\u300d\u3092\u753b\u9762\u306b\u51fa\u529b\u3059\u308b\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tvoid play()\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u300c\u904a\u3073\u307e\u3057\u305f\u3002\u300d\u3092\u753b\u9762\u306b\u51fa\u529b\u3059\u308b\n\t\t\t<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"Pre-title\">ImplPetShop.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>package shop;\r\n\r\nimport catpac.Cat;\r\nimport dogpac.Dog;\r\nimport petpac.Pet;\r\n\r\npublic class ImplPetShop {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tPet myPet = new Pet();\r\n\t\tImplPetShop.buyPet(myPet);\r\n\r\n\t\tSystem.out.println(\"---\");\r\n\r\n\t\tCat myCat = new Cat();\r\n\t\tImplPetShop.buyPet(myCat);\r\n\r\n\t\tmyCat = new Cat(\"\u30a2\u30e1\u30ea\u30ab\u30f3\u30b7\u30e7\u30fc\u30c8\u30d8\u30a2\u30fc\",\"\u30aa\u30b9\", 0);\r\n\t\tImplPetShop.buyPet(myCat);\r\n\r\n\t\tSystem.out.println(\"---\");\r\n\r\n\t\tDog myDog = new Dog();\r\n\t\tImplPetShop.buyPet(myDog);\r\n\r\n\t\tmyDog = new Dog(\"\u30b4\u30fc\u30eb\u30c7\u30f3\u30ea\u30c8\u30ea\u30d0\u30fc\",\"\u30aa\u30b9\", 0);\r\n\t\tImplPetShop.buyPet(myDog);\r\n\t}\r\n\r\n\tstatic void buyPet(Pet tPet) {\r\n\t\tSystem.out.println(tPet.getSyurui()\r\n\t\t\t+ \"\u306e\"\r\n\t\t\t+ tPet.getSeibetsu()\r\n\t\t\t+ \"\u3001\"\r\n\t\t\t+ tPet.getToshi() + \"\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\");\r\n\r\n\t\ttPet.eat();\r\n\t\ttPet.play();\r\n\t}\r\n}<\/code><\/pre>\n<div class=\"Pre-title\">\u5b9f\u884c\u7d50\u679c<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>\u306a\u305e\u306e\u751f\u7269\u306e\u6027\u5225\u4e0d\u660e\u30010\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\r\n\u3054\u306f\u3093\u3092\u98df\u3079\u307e\u3057\u305f\u3002\r\n\u904a\u3073\u307e\u3057\u305f\u3002\r\n---\r\n\u30b9\u30b3\u30c6\u30a3\u30c3\u30b7\u30e5\u30d5\u30a9\u30fc\u30eb\u30c9\u306e\u30e1\u30b9\u30010\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\r\n\u3054\u306f\u3093\u3092\u98df\u3079\u307e\u3057\u305f\u3002\r\n\u904a\u3073\u307e\u3057\u305f\u3002\r\n\u30a2\u30e1\u30ea\u30ab\u30f3\u30b7\u30e7\u30fc\u30c8\u30d8\u30a2\u30fc\u306e\u30aa\u30b9\u30010\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\r\n\u3054\u306f\u3093\u3092\u98df\u3079\u307e\u3057\u305f\u3002\r\n\u904a\u3073\u307e\u3057\u305f\u3002\r\n---\r\n\u30c8\u30a4\u30d7\u30fc\u30c9\u30eb\u306e\u30e1\u30b9\u30010\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\r\n\u3054\u306f\u3093\u3092\u98df\u3079\u307e\u3057\u305f\u3002\r\n\u904a\u3073\u307e\u3057\u305f\u3002\r\n\u30b4\u30fc\u30eb\u30c7\u30f3\u30ea\u30c8\u30ea\u30d0\u30fc\u306e\u30aa\u30b9\u30010\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\r\n\u3054\u306f\u3093\u3092\u98df\u3079\u307e\u3057\u305f\u3002\r\n\u904a\u3073\u307e\u3057\u305f\u3002<\/code><\/pre>\n<p><span class=\"Text-highlight\">\u203b\u3053\u306e\u554f\u984c\u306e\u89e3\u7b54\u306f\u63b2\u8f09\u3057\u3066\u304a\u308a\u307e\u305b\u3093\u3002<span class=\"Post-link\" >Tech Fun IT\u30b9\u30af\u30fc\u30eb\u306eJava\u7814\u4fee<\/span>\u3067\u306f\u3001\u8b1b\u5e2b\u304c\u4e01\u5be7\u306b\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/span><br \/>\n<span class=\"Text-red-bold\">\u73fe\u5728Tech Fun IT\u30b9\u30af\u30fc\u30eb\u3067\u306f\u3001\u65b0\u898f\u53d7\u8b1b\u8005\u306e\u52df\u96c6\u306f\u884c\u306a\u3063\u3066\u304a\u308a\u307e\u305b\u3093\u3002<\/span><\/p>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-8-3\"><span class=\"Num\">8.3.<\/span>\u554f\u984c3<\/h4>\n<p>Cat\u30af\u30e9\u30b9\u3068Dog\u30af\u30e9\u30b9\u306b\u3001\u7d99\u627f\u3055\u308c\u3066\u3044\u308bPet\u30af\u30e9\u30b9\u306eeat\u30e1\u30bd\u30c3\u30c9\u3068play\u30e1\u30bd\u30c3\u30c9\u3092\u4ee5\u4e0b\u306e\u5185\u5bb9\u3067\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u554f\u984c2\u3067\u4f5c\u6210\u3057\u305fImplPetShop\u30af\u30e9\u30b9\u304c\u5b9f\u884c\u7d50\u679c\u306e\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<table class=\"Base-table\">\n<colgroup>\n<col>\n<col>\n<col>\n\t<\/colgroup>\n<tbody>\n<tr>\n<th>\n\t\t\t\t\u30af\u30e9\u30b9\n\t\t\t<\/th>\n<td>\n\t\t\t\tCat\n\t\t\t<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<th rowspan=\"2\">\n\t\t\t\t\u30e1\u30bd\u30c3\u30c9\n\t\t\t<\/th>\n<td>\n\t\t\t\tvoid eat()\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u300c\u5927\u597d\u304d\u306a\u9b5a\u3092\u98df\u3079\u307e\u3057\u305f\u3002\u300d\u3092\u753b\u9762\u306b\u51fa\u529b\u3059\u308b\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tvoid play()\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u300c\u306d\u305a\u307f\u306e\u304a\u3082\u3061\u3083\u3067\u904a\u3073\u307e\u3057\u305f\u3002\u300d\u3092\u753b\u9762\u306b\u51fa\u529b\u3059\u308b\n\t\t\t<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table class=\"Base-table\">\n<colgroup>\n<col>\n<col>\n<col>\n\t<\/colgroup>\n<tbody>\n<tr>\n<th>\n\t\t\t\t\u30af\u30e9\u30b9\n\t\t\t<\/th>\n<td>\n\t\t\t\tDog\n\t\t\t<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<th rowspan=\"2\">\n\t\t\t\t\u30e1\u30bd\u30c3\u30c9\n\t\t\t<\/th>\n<td>\n\t\t\t\tvoid eat()\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u300c\u5927\u597d\u304d\u306a\u8089\u3092\u98df\u3079\u307e\u3057\u305f\u3002\u300d\u3092\u753b\u9762\u306b\u51fa\u529b\u3059\u308b\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tvoid play()\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u300c\u516c\u5712\u3067\u8d70\u3063\u3066\u904a\u3073\u307e\u3057\u305f\u3002\u300d\u3092\u753b\u9762\u306b\u51fa\u529b\u3059\u308b\n\t\t\t<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"Pre-title\">\u5b9f\u884c\u7d50\u679c<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>\u306a\u305e\u306e\u751f\u7269\u306e\u6027\u5225\u4e0d\u660e\u30010\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\r\n\u3054\u306f\u3093\u3092\u98df\u3079\u307e\u3057\u305f\u3002\r\n\u904a\u3073\u307e\u3057\u305f\u3002\r\n---\r\n\u30b9\u30b3\u30c6\u30a3\u30c3\u30b7\u30e5\u30d5\u30a9\u30fc\u30eb\u30c9\u306e\u30e1\u30b9\u30010\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\r\n\u5927\u597d\u304d\u306a\u9b5a\u3092\u98df\u3079\u307e\u3057\u305f\u3002\r\n\u306d\u305a\u307f\u306e\u304a\u3082\u3061\u3083\u3067\u904a\u3073\u307e\u3057\u305f\u3002\r\n\u30a2\u30e1\u30ea\u30ab\u30f3\u30b7\u30e7\u30fc\u30c8\u30d8\u30a2\u30fc\u306e\u30aa\u30b9\u30010\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\r\n\u5927\u597d\u304d\u306a\u9b5a\u3092\u98df\u3079\u307e\u3057\u305f\u3002\r\n\u306d\u305a\u307f\u306e\u304a\u3082\u3061\u3083\u3067\u904a\u3073\u307e\u3057\u305f\u3002\r\n---\r\n\u30c8\u30a4\u30d7\u30fc\u30c9\u30eb\u306e\u30e1\u30b9\u30010\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\r\n\u5927\u597d\u304d\u306a\u8089\u3092\u98df\u3079\u307e\u3057\u305f\u3002\r\n\u516c\u5712\u3067\u8d70\u3063\u3066\u904a\u3073\u307e\u3057\u305f\u3002\r\n\u30b4\u30fc\u30eb\u30c7\u30f3\u30ea\u30c8\u30ea\u30d0\u30fc\u306e\u30aa\u30b9\u30010\u6b73\u3092\u8cb7\u3044\u307e\u3057\u305f\u3002\r\n\u5927\u597d\u304d\u306a\u8089\u3092\u98df\u3079\u307e\u3057\u305f\u3002\r\n\u516c\u5712\u3067\u8d70\u3063\u3066\u904a\u3073\u307e\u3057\u305f\u3002<\/code><\/pre>\n<div class=\"Answer-block\">\n\t<input class=\"SW\" type=\"checkbox\" id=\"Answer-content-2\"><label for=\"Answer-content-2\" class=\"Answer-SW\"><span\n\t\t\tclass=\"Google-icon Google-icon--arrow-single-gray\"><\/span>\u89e3\u7b54\u3092\u8868\u793a\u3059\u308b<\/label><\/p>\n<div class=\"Answer-content\">\n<div class=\"Pre-title\">Cat.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>package catpac;\r\n\r\nimport petpac.Pet;\r\n\r\npublic class Cat extends Pet {\r\n\r\n\tpublic Cat() {\r\n\t\tsuper(\"\u30b9\u30b3\u30c6\u30a3\u30c3\u30b7\u30e5\u30d5\u30a9\u30fc\u30eb\u30c9\", \"\u30e1\u30b9\", 0);\r\n\t}\r\n\r\n\tpublic Cat(String syurui, String seibetsu, int toshi) {\r\n\t\tsuper(syurui, seibetsu, toshi);\r\n\t}\r\n\r\n\t\/\/ eat\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\r\n\tpublic void eat() {\r\n\t\tSystem.out.println(\"\u5927\u597d\u304d\u306a\u9b5a\u3092\u98df\u3079\u307e\u3057\u305f\u3002\");\r\n\t}\r\n\r\n\t\/\/ play\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\r\n\tpublic void play() {\r\n\t\tSystem.out.println(\"\u306d\u305a\u307f\u306e\u304a\u3082\u3061\u3083\u3067\u904a\u3073\u307e\u3057\u305f\u3002\");\r\n\t}\r\n}<\/code><\/pre>\n<p>\t\t\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u306f\u3001\u89aa\u30af\u30e9\u30b9\u304c\u6301\u3064\u30e1\u30bd\u30c3\u30c9\u3092\u66f8\u304d\u304b\u3048\u308b\u3053\u3068\u3067\u3059\u3002<br \/>\n\t\t\u89aa\u30af\u30e9\u30b9\u306ePet\u30af\u30e9\u30b9\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308beat\u30e1\u30bd\u30c3\u30c9\u3068play\u30e1\u30bd\u30c3\u30c9\u306e\u51e6\u7406\u3092Cat\u30af\u30e9\u30b9\u306e\u5185\u5bb9\u306b\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"Pre-title\">Dog.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>package dogpac;\r\n\r\nimport petpac.Pet;\r\n\r\npublic class Dog extends Pet {\r\n\r\n\tpublic Dog() {\r\n\t\tsuper(\"\u30c8\u30a4\u30d7\u30fc\u30c9\u30eb\", \"\u30e1\u30b9\", 0);\r\n\t}\r\n\r\n\tpublic Dog(String syurui, String seibetsu, int toshi) {\r\n\t\tsuper(syurui, seibetsu, toshi);\r\n\t}\r\n\r\n\t\/\/ eat\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\r\n\tpublic void eat() {\r\n\t\tSystem.out.println(\"\u5927\u597d\u304d\u306a\u8089\u3092\u98df\u3079\u307e\u3057\u305f\u3002\");\r\n\t}\r\n\r\n\t\/\/ play\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\r\n\tpublic void play() {\r\n\t\tSystem.out.println(\"\u516c\u5712\u3067\u8d70\u3063\u3066\u904a\u3073\u307e\u3057\u305f\u3002\");\r\n\t}\r\n}<\/code><\/pre>\n<p>\t\tCat\u30af\u30e9\u30b9\u3068\u540c\u69d8\u306b\u3001eat\u30e1\u30bd\u30c3\u30c9\u3068play\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3066\u3044\u307e\u3059\u3002\n\t<\/p><\/div>\n<\/div>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-8-4\"><span class=\"Num\">8.4.<\/span>\u554f\u984c4<\/h4>\n<p>\u300cPolymorphismMondai4\u300d\u306f\u3001Cat\u30af\u30e9\u30b9\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3057\u3001getName\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u5b9f\u884c\u7d50\u679c\u306e\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u3001\u554f\u984c3\u3067\u4f7f\u7528\u3057\u305fCat\u30af\u30e9\u30b9\u306e\u4e2d\u306bgetName\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u6210\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<div class=\"Pre-title\">PolymorphismMondai4.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public class PolymorphismMondai4 {\r\n\r\n\tpublic static void main(String[] args) {\r\n\r\n\t\tCat cat = new Cat();\r\n\r\n\t\tSystem.out.println(\"\u543e\u8f29\u306f\u732b\u3067\u3042\u308b\u3002\" + cat.getName());\r\n\t\tSystem.out.println(\"\u543e\u8f29\u306f\u732b\u3067\u3042\u308b\u3002\" + cat.getName(\"\u30df\u30b1\"));\r\n\t}\r\n\r\n}<\/code><\/pre>\n<div class=\"Pre-title\">\u5b9f\u884c\u7d50\u679c<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>\u543e\u8f29\u306f\u732b\u3067\u3042\u308b\u3002\u540d\u524d\u306f\u307e\u3060\u306a\u3044\u3002\r\n\u543e\u8f29\u306f\u732b\u3067\u3042\u308b\u3002\u540d\u524d\u306f\u30df\u30b1\u3068\u3044\u3046\u3002<\/code><\/pre>\n<p><span class=\"Text-highlight\">\u203b\u3053\u306e\u554f\u984c\u306e\u89e3\u7b54\u306f\u63b2\u8f09\u3057\u3066\u304a\u308a\u307e\u305b\u3093\u3002<span class=\"Post-link\" >Tech Fun IT\u30b9\u30af\u30fc\u30eb\u306eJava\u7814\u4fee<\/span>\u3067\u306f\u3001\u8b1b\u5e2b\u304c\u4e01\u5be7\u306b\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/span><br \/>\n<span class=\"Text-red-bold\">\u73fe\u5728Tech Fun IT\u30b9\u30af\u30fc\u30eb\u3067\u306f\u3001\u65b0\u898f\u53d7\u8b1b\u8005\u306e\u52df\u96c6\u306f\u884c\u306a\u3063\u3066\u304a\u308a\u307e\u305b\u3093\u3002<\/span><\/p>\n<h4 class=\"Heading Title Title--s\" id=\"Bookmark-8-5\"><span class=\"Num\">8.5.<\/span>\u554f\u984c5<\/h4>\n<p>\u62bd\u8c61\u30af\u30e9\u30b9\u300cAbstractShop\u300d\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n\u305d\u306e\u5f8c\u3001\u62bd\u8c61\u30af\u30e9\u30b9\u300cAbstractShop\u300d\u3092\u5b9f\u88c5\u3057\u305f\u3001\u4ee5\u4e0b\u306e\uff13\u3064\u306e\u30af\u30e9\u30b9\u3092\u5b9f\u88c5\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<table class=\"Base-table\">\n<colgroup>\n<col>\n<col>\n\t<\/colgroup>\n<thead>\n<tr>\n<th>\u30af\u30e9\u30b9\u540d<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n\t\t\t\tDepartmentStore\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u300c\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u3068\u73fe\u91d1\u6c7a\u6e08\u3002\u300d\u3068\u51fa\u529b\u3059\u308b\u3002\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tConvenienceStore\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u300c\u96fb\u5b50\u30de\u30cd\u30fc\u6c7a\u6e08\u3068\u73fe\u91d1\u6c7a\u6e08\u3002\u300d\u3068\u51fa\u529b\u3059\u308b\u3002\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tStore\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u300c\u73fe\u91d1\u6c7a\u6e08\u306e\u307f\u3002\u300d\u3068\u51fa\u529b\u3059\u308b\u3002\n\t\t\t<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"Pre-title\">AbstractShop.java<\/div>\n<pre class=\"Copy prettyprint lang-js\"><code>public abstract class AbstractShop {\r\n\r\n\t\/\/ \u652f\u6255\u65b9\u6cd5\u3092\u30b3\u30f3\u30bd\u30fc\u30eb\u51fa\u529b\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3002\r\n\tpublic abstract void payment();\r\n\r\n}<\/code><\/pre>\n<p><span class=\"Text-highlight\">\u203b\u3053\u306e\u554f\u984c\u306e\u89e3\u7b54\u306f\u63b2\u8f09\u3057\u3066\u304a\u308a\u307e\u305b\u3093\u3002<span class=\"Post-link\" >Tech Fun IT\u30b9\u30af\u30fc\u30eb\u306eJava\u7814\u4fee<\/span>\u3067\u306f\u3001\u8b1b\u5e2b\u304c\u4e01\u5be7\u306b\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/span><br \/>\n<span class=\"Text-red-bold\">\u73fe\u5728Tech Fun IT\u30b9\u30af\u30fc\u30eb\u3067\u306f\u3001\u65b0\u898f\u53d7\u8b1b\u8005\u306e\u52df\u96c6\u306f\u884c\u306a\u3063\u3066\u304a\u308a\u307e\u305b\u3093\u3002<\/span>\t\t<\/p>\n<div class=\"Separator\">\n<div class=\"Separator__child\"><\/div>\n<\/div>\n<h3 class=\"Heading Title Title--m\" id=\"Bookmark-9\"><span class=\"Num\">9.<\/span>\u672c\u7ae0\u306e\u307e\u3068\u3081<\/h3>\n<ul class=\"Base-list\">\n<li class=\"Base-list__child\">\u300c\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u300d\u3068\u306f\u3001\u5f15\u6570\u306e\u6570\u3082\u3057\u304f\u306f\u578b\u304c\u7570\u306a\u308b\u540c\u540d\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3002 <\/li>\n<li class=\"Base-list__child\">\u300c\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u300d\u3068\u306f\u3001\u89aa\u30af\u30e9\u30b9\u3067\u5b9a\u7fa9\u3057\u305f\u30e1\u30bd\u30c3\u30c9\u3092\u5b50\u30af\u30e9\u30b9\u3067\u518d\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3002 <\/li>\n<li class=\"Base-list__child\">\u62bd\u8c61\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3068\u304d\u3084\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u3068\u304d\u306f\u3001abstract\u4fee\u98fe\u5b50\u300d\u3092\u4f7f\u7528\u3059\u308b\u3002 <\/li>\n<li class=\"Base-list__child\">\u62bd\u8c61\u30af\u30e9\u30b9\u306f\u305d\u306e\u307e\u307e\u3067\u306f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u5fc5\u305a\u5b50\u30af\u30e9\u30b9\u3067\u7d99\u627f\u3057\u3066\u4f7f\u7528\u3059\u308b\u3002 <\/li>\n<li class=\"Base-list__child\">\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u5834\u5408\u306f\u3001class\u3067\u306f\u306a\u304f\u300cinterface\u300d\u3067\u5ba3\u8a00\u3059\u308b\u3002<\/li>\n<li class=\"Base-list__child\">\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3082\u305d\u306e\u307e\u307e\u3067\u306f\u5229\u7528\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u300cimplements\u300d\u3092\u6307\u5b9a\u3057\u305f\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3057\u3001\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002 <\/li>\n<\/ul>\n<p>\u7528\u8a9e\u306e\u610f\u5473\u306a\u3069\u306b\u4e0d\u660e\u70b9\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u6559\u6750\u3092\u3082\u3046\u4e00\u5ea6\u8aad\u307f\u76f4\u3059\u306a\u3069\u3057\u3066\u5fa9\u7fd2\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30dd\u30ea\u30e2\u30d5\u30a3\u30ba\u30e0\u306b\u3064\u3044\u3066\u306e\u8aac\u660e\u306f\u3001\u4ee5\u4e0a\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u672c\u7ae0\u3067\u306e\u5b66\u7fd2\u9805\u76ee \u672c\u7ae0\u3067\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u884c\u3046\u306e\u306b\u91cd\u8981\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u3067\u3042\u308b\u30dd\u30ea\u30e2\u30d5\u30a3\u30ba\u30e0\uff08\u591a\u614b\u6027\uff09\u306b\u95a2\u3057\u3066\u5b66\u7fd2\u3057\u307e\u3059\u3002 2.\u672c\u7ae0\u306e\u8b1b\u7fa9 \u672c\u7ae0\u3067\u5b66\u7fd2\u3059\u308b\u5185\u5bb9\u3092\u52d5\u753b\u3068\u3057\u3066\u307e\u3068\u3081\u305f\u3082\u306e\u3067\u3059\u3002\u6700\u521d\u306b\u4e00\u901a\u308a\u898b\u7d42\u308f\u2026<\/p>\n","protected":false},"author":5,"featured_media":6005,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"class_list":["post-180","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-base"],"acf":{"chapter":10,"javabase_order":11,"list-display_description":"\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u884c\u3046\u306e\u306b\u91cd\u8981\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u3067\u3042\u308b\u30dd\u30ea\u30e2\u30d5\u30a3\u30ba\u30e0\uff08\u591a\u614b\u6027\uff09\u306b\u95a2\u3057\u3066\u5b66\u7fd2\u3057\u307e\u3059\u3002"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/techfun.cc\/wp-json\/wp\/v2\/posts\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techfun.cc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techfun.cc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techfun.cc\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/techfun.cc\/wp-json\/wp\/v2\/comments?post=180"}],"version-history":[{"count":23,"href":"https:\/\/techfun.cc\/wp-json\/wp\/v2\/posts\/180\/revisions"}],"predecessor-version":[{"id":6510,"href":"https:\/\/techfun.cc\/wp-json\/wp\/v2\/posts\/180\/revisions\/6510"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techfun.cc\/wp-json\/wp\/v2\/media\/6005"}],"wp:attachment":[{"href":"https:\/\/techfun.cc\/wp-json\/wp\/v2\/media?parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techfun.cc\/wp-json\/wp\/v2\/categories?post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}