﻿{"id":83,"date":"2012-05-18T11:37:21","date_gmt":"2012-05-18T02:37:21","guid":{"rendered":"http:\/\/yucchi.jp\/blog\/?p=83"},"modified":"2013-04-24T22:41:25","modified_gmt":"2013-04-24T13:41:25","slug":"static-static-fantastic-vol-5","status":"publish","type":"post","link":"http:\/\/yucchi.jp\/blog\/?p=83","title":{"rendered":"static static Fantastic! vol.5"},"content":{"rendered":"<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">\u4eca\u671d\u6295\u7a3f\u3057\u305f\u8a18\u4e8b\u3060\u3051\u3069\u8ab0\u3082\u91e3\u3089\u308c\u3066\u304f\u308c\u306a\u3044\u304b\u3089\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5c11\u3057\u5909\u66f4\u3057\u3066\u307f\u305f\u3002<\/font><\/p>\n<p><font size=\"3\"><\/font><\/p>\n<style type=\"text\/css\">\n<!--\ntable {color: #000000; background-color: #e9e8e2; font-family: \u3086\u305f\u307d\u3093\uff08\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09}\n-->\n<\/style>\n<table width=\"100%\">\n<tbody>\n<tr>\n<td align=\"left\">jp\\yucchi\\static_sample_4\\hoge.java<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre>\r\npackage jp.yucchi.static_sample_4;\r\n\r\npublic class hoge {\r\nstatic int VAL = 10000;\r\n\r\n    static void calc(int i) {\r\n        System.out.println(\"CALL hoge\");\r\n        System.out.println(\"VAL = \" + VAL);\r\n        System.out.println(VAL + \"\uff0a \uff12 = \" + VAL * 2);\r\n\r\n    }\r\n}\r\n<\/pre>\n<table width=\"100%\">\n<tbody>\n<tr>\n<td align=\"left\">jp\\yucchi\\static_sample_4\\chage.java<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre>\r\npackage jp.yucchi.static_sample_4;\r\n\r\npublic class chage {\r\nstatic int VAL = 1;\r\n\r\n    static void calc(int i) {\r\n        System.out.println(\"CALL chage\");\r\n        System.out.println(\"VAL = \" + VAL);\r\n        System.out.println(VAL + \"\uff0a \uff12 = \" + VAL * 2);\r\n\r\n    }\r\n}\r\n<\/pre>\n<table width=\"100%\">\n<tbody>\n<tr>\n<td align=\"left\">jp\\yucchi\\static_sample_4\\Static_sample_4.java<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre>\r\npackage jp.yucchi.static_sample_4;\r\n\r\nimport static jp.yucchi.static_sample_4.hoge.*;\r\nimport static jp.yucchi.static_sample_4.chage.VAL;\r\n\r\npublic class Static_sample_4 {\r\n\r\n    public static void main(String[] args) {\r\n        System.out.println(\"main() atart VAL = \" + VAL);\r\n        calc(VAL);\r\n        System.out.println(\"main() end VAL = \" + VAL);\r\n    }\r\n}\r\n\r\n<\/pre>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">VAL \u306e\u5024\u3092\u6a19\u6e96\u51fa\u529b\u3055\u305b\u3066\u307f\u307e\u3057\u305f\u3002<\/font><\/p>\n<p>run:<br \/>main() atart VAL = 1<br \/>CALL hoge<br \/>VAL = 10000<br \/>10000\uff0a \uff12 = 20000<br \/>main() end VAL = 1<br \/>\u69cb\u7bc9\u6210\u529f (\u5408\u8a08\u6642\u9593: 0 \u79d2)<\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">hoge \u30af\u30e9\u30b9\u306e calc() \u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u3066\u307e\u3059\u3002<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">main() \u30e1\u30bd\u30c3\u30c9\u306e\u4e2d\u306b\u3042\u308b calc() \u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u306e\u5024\u306f\uff11\u306e\u3088\u3046\u3067\u3059\u3002<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">\u305d\u3057\u3066\u3001calc(VAL) \u30e1\u30bd\u30c3\u30c9\u3067\u3088\u3070\u308c\u308b\u306e\u304c hoge \u30af\u30e9\u30b9\u306a\u306e\u306f\u4f55\u6545\uff1f<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">\u305d\u306e\u7b54\u3048\u306f\u5358\u7d14\u3067\u3059\u3002<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">static import \u6587\u3092\u3088\u304f\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">chage \u30af\u30e9\u30b9\u306f static \u5909\u6570\u3067\u3042\u308b VAL \u3060\u3051\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">\u3088\u3063\u3066\u3001chage \u30af\u30e9\u30b9\u306e calc(VAL) \u30e1\u30bd\u30c3\u30c9\u306f\u547c\u3070\u308c\u308b\u3053\u3068\u306f\u7121\u3044\u3093\u3067\u3059\u3002<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">hoge \u30af\u30e9\u30b9\u306e calc(VAL) \u304c\u547c\u3070\u308c\u3066 hoge \u30af\u30e9\u30b9\u306e VAL \u306e\u5024\u3067\u8a08\u7b97\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">\u306a\u304b\u306a\u304b\u9762\u767d\u3044\u3053\u3068\u306b\u306a\u3063\u3066\u307e\u3059\u306d\u3002<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">\u5f15\u6570\u306e\u5024\u3088\u308a\u30af\u30e9\u30b9\u306e static \u5909\u6570\u304c\u512a\u5148\u3055\u308c\u3066\u3057\u307e\u3046\u3002<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">chage \u30af\u30e9\u30b9\u306e calc(VAL) \u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3055\u305b\u305f\u304b\u3063\u305f\u3089<\/font><\/p>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">\u6b21\u306e\u3088\u3046\u306b\u30a4\u30f3\u30dd\u30fc\u30c8\u6587\u3092\u5909\u66f4\u3057\u305f\u3089\u3044\u3044\u3002<\/font><\/p>\n<pre>\r\npackage jp.yucchi.static_sample_4;\r\n\r\nimport static jp.yucchi.static_sample_4.hoge.*;\r\nimport static jp.yucchi.static_sample_4.chage.VAL;\r\nimport static jp.yucchi.static_sample_4.chage.calc;\r\n\r\n<\/pre>\n<p><font size=\"3\" face=\"\u30e1\u30a4\u30ea\u30aa\">\u3063\u3066\u3044\u3046\u304b\u30fb\u30fb\u30fb\u3000hoge \u30af\u30e9\u30b9\u4f7f\u308f\u306a\u304d\u3083\u3044\u3044\u3058\u3083\u3093(^_^;)<\/font><\/p>\n<div style=\"padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px\" id=\"scid:0767317B-992E-4b12-91E0-4F059A8CECA8:254307de-c618-4020-b3c9-0e39547de2b2\" class=\"wlWriterEditableSmartContent\">Hatena \u30bf\u30b0: <a href=\"http:\/\/b.hatena.ne.jp\/t\/Java\" rel=\"tag\">Java<\/a><\/div>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_hatena\"><a href='\/\/b.hatena.ne.jp\/add?mode=confirm&url=http%3A%2F%2Fyucchi.jp%2Fblog%2F%3Fp%3D83&title=static%20static%20Fantastic%21%20vol.5' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='http:\/\/yucchi.jp\/blog\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/hatena.gif' alt='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' width='16' height='12' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_facebook\"><a href='http:\/\/www.facebook.com\/share.php?u=http%3A%2F%2Fyucchi.jp%2Fblog%2F%3Fp%3D83&t=static%20static%20Fantastic%21%20vol.5' title='Facebook \u306b\u30b7\u30a7\u30a2' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='http:\/\/yucchi.jp\/blog\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/facebook.png' alt='Facebook \u306b\u30b7\u30a7\u30a2' title='Facebook \u306b\u30b7\u30a7\u30a2' width='16' height='16' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"http:\/\/yucchi.jp\/blog\/?p=83\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"http:\/\/yucchi.jp\/blog\/?p=83\" data-text=\"static static Fantastic! vol.5\" data-lang=\"ja\">Tweet<\/a><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u671d\u6295\u7a3f\u3057\u305f\u8a18\u4e8b\u3060\u3051\u3069\u8ab0\u3082\u91e3\u3089\u308c\u3066\u304f\u308c\u306a\u3044\u304b\u3089\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5c11\u3057\u5909\u66f4\u3057\u3066\u307f\u305f\u3002 jp\\yucchi\\static_sample_4\\hoge.java package jp.yucchi.static_sample_4; public class hoge { static int VAL = 10000; static void calc(int i) { System.out.println(&#8220;CALL hoge&#8221;); System.out.println(&#8220;VAL = &#8221; + VAL); System.out.println(VAL + &#8220;\uff0a \uff12 = &#8221; + VAL * 2); } } j\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[17],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-java","tag-java"],"_links":{"self":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=83"}],"version-history":[{"count":4,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":855,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions\/855"}],"wp:attachment":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}