{"id":105170,"date":"2024-03-22T09:24:35","date_gmt":"2024-03-22T00:24:35","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"},"modified":"2024-04-04T10:05:09","modified_gmt":"2024-04-04T01:05:09","slug":"java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","title":{"rendered":"Java\u306etoString\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>Java\u3067\u306f\u3001\u6587\u5b57\u5217\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u5374\u3059\u308btoString()\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u3084\u30ed\u30b0\u51fa\u529b\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<p>toString()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u624b\u9806\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u6587\u5b57\u5217\u306b\u5909\u63db<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-meta\">@Override<\/span>\r\n<span class=\"hljs-keyword\">public<\/span> String <span class=\"hljs-title function_\">toString<\/span><span class=\"hljs-params\">()<\/span> {\r\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-string\">\"MyObject{\"<\/span> +\r\n            <span class=\"hljs-string\">\"field1=\"<\/span> + field1 +\r\n            <span class=\"hljs-string\">\", field2='\"<\/span> + field2 + <span class=\"hljs-string\">'\\''<\/span> +\r\n            <span class=\"hljs-string\">'}'<\/span>;\r\n}\r\n<\/code><\/pre>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001MyObject \u30af\u30e9\u30b9\u304c toString() \u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3001\u30d5\u30a3\u30fc\u30eb\u30c9 field1 \u3068 field2 \u3092\u542b\u3080\u6587\u5b57\u5217\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u6587\u5b57\u5217\u306b\u5909\u63db<\/li>\n<li>\u6587\u5b57\u5217\u306b\u5909\u63db\u3059\u308b<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-type\">MyObject<\/span> <span class=\"hljs-variable\">obj<\/span> <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">MyObject<\/span>();\r\nSystem.out.println(obj.toString());\r\n<\/code><\/pre>\n<p>\u4e0a\u306e\u30b3\u30fc\u30c9\u306f\u3001MyObject\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u6587\u5b57\u5217\u8868\u73fe\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u6587\u5b57\u5217\u306b\u5909\u63db\u3059\u308b<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-type\">MyObject<\/span> <span class=\"hljs-variable\">obj<\/span> <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">MyObject<\/span>();\r\nSystem.out.println(obj);  <span class=\"hljs-comment\">\/\/ \u7b49\u540c\u4e8e System.out.println(obj.toString());<\/span>\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u306f\u3001MyObject\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u6587\u5b57\u5217\u8868\u73fe\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<p>\u5168\u3066\u306e Java \u30af\u30e9\u30b9\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067 Object \u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u3001Object \u30af\u30e9\u30b9\u306b\u306f\u30af\u30e9\u30b9\u540d\u3068\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30cf\u30c3\u30b7\u30e5\u30b3\u30fc\u30c9\u304b\u3089\u306a\u308b\u6587\u5b57\u5217\u3092\u8fd4\u3059 toString() \u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308a\u307e\u3059\u3002\u3042\u306a\u305f\u306e\u30af\u30e9\u30b9\u304c toString() \u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u3001Object \u30af\u30e9\u30b9\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u5b9f\u88c5\u304c\u5229\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u3067\u306f\u3001\u6587\u5b57\u5217\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u5374\u3059\u308btoString()\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u3084\u30ed\u30b0\u51fa\u529b\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002 toString()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u624b\u9806\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002 \u6587\u5b57\u5217\u306b\u5909\u63db @Override publ [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-105170","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java\u306etoString\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/java\u306etostring\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u306etoString\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"Java\u3067\u306f\u3001\u6587\u5b57\u5217\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u5374\u3059\u308btoString()\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u3084\u30ed\u30b0\u51fa\u529b\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002 toString()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u624b\u9806\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002 \u6587\u5b57\u5217\u306b\u5909\u63db @Override publ [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/java\u306etostring\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-22T00:24:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-04T01:05:09+00:00\" \/>\n<meta name=\"author\" content=\"\u512a\u6597, \u671d\u967d\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u512a\u6597, \u671d\u967d\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"name\":\"Java\u306etoString\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2024-03-22T00:24:35+00:00\",\"dateModified\":\"2024-04-04T01:05:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\u306etoString\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28\",\"name\":\"\u512a\u6597, \u671d\u967d\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g\",\"caption\":\"\u512a\u6597, \u671d\u967d\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/yutoasahi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Java\u306etoString\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/java\u306etostring\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\/","og_locale":"ja_JP","og_type":"article","og_title":"Java\u306etoString\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5","og_description":"Java\u3067\u306f\u3001\u6587\u5b57\u5217\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u5374\u3059\u308btoString()\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u3084\u30ed\u30b0\u51fa\u529b\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002 toString()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u624b\u9806\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002 \u6587\u5b57\u5217\u306b\u5909\u63db @Override publ [&hellip;]","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/java\u306etostring\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-03-22T00:24:35+00:00","article_modified_time":"2024-04-04T01:05:09+00:00","author":"\u512a\u6597, \u671d\u967d","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u512a\u6597, \u671d\u967d"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","name":"Java\u306etoString\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2024-03-22T00:24:35+00:00","dateModified":"2024-04-04T01:05:09+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Java\u306etoString\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28","name":"\u512a\u6597, \u671d\u967d","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g","caption":"\u512a\u6597, \u671d\u967d"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/yutoasahi\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%aetostring%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/105170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=105170"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/105170\/revisions"}],"predecessor-version":[{"id":269508,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/105170\/revisions\/269508"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=105170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=105170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=105170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}