{"id":1358,"date":"2008-07-27T23:19:00","date_gmt":"2008-07-27T14:19:00","guid":{"rendered":"https:\/\/hdmr.org\/d\/?e=74"},"modified":"2008-07-27T23:19:00","modified_gmt":"2008-07-27T14:19:00","slug":"blogn-74","status":"publish","type":"post","link":"https:\/\/hdmr.org\/d\/?e=74","title":{"rendered":"\u9759\u7684\u5909\u6570\u3063\u3066\u3069\u308c\u3050\u3089\u3044\u5f79\u306b\u7acb\u3064?"},"content":{"rendered":"<p>C#\u306e\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u306a\u305c\u304b\u30af\u30e9\u30b9\u306b\u5c5e\u3055\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002<br \/>\u305d\u3093\u306a\u306e\u306f\u3042\u3093\u307e\u308a\u6c17\u306b\u3059\u308b\u3053\u3068\u3067\u306f\u306a\u3044\u3057\u3001Java\u3067\u3082\u305d\u306e\u306f\u305a\u3002<br \/>\u307e\u3041C#\u306e\u30eb\u30fc\u30eb\u3092\u4e71\u3055\u306a\u3044\u305f\u3081\u4fbf\u5b9c\u4e0a\u30af\u30e9\u30b9\u306b\u5c5e\u3057\u3066\u3044\u308b\u3068\u3001\u305d\u3046\u8003\u3048\u308b\u306e\u304c\u59a5\u5f53\u3067\u3057\u3087\u3046\u3002<br \/>\u3059\u3079\u3066\u306e\u30e1\u30bd\u30c3\u30c9\u30fb\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u30af\u30e9\u30b9\u307e\u305f\u306f\u69cb\u9020\u4f53\u306b\u5c5e\u3059\u308b\u3068\u3044\u3046\u3084\u3064\u306d\u3002<br \/>\u307e\u3041\u305d\u3093\u306a\u3082\u3093\u304b\u3068\u601d\u3048\u3070\u7d0d\u5f97\u306e\u3044\u304f\u8a71\u3067\u3059\u3002<br \/>\u3060\u304b\u3089\u95a2\u9023\u3059\u308b\u30af\u30e9\u30b9\u306b\u9759\u7684\u30af\u30e9\u30b9\u30fb\u9759\u7684\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u914d\u7f6e\u3057\u305f\u3068\u305d\u3046\u3044\u3046\u3053\u3068\u3067\u3059\u3002<br \/>\u4f8b\u3048\u3070\u3001\u5358\u4f4d\u30d9\u30af\u30c8\u30eb\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u30d9\u30af\u30c8\u30eb\u30af\u30e9\u30b9\u306b\u8a2d\u3051\u305f\u308a\u3002<\/p>\n<hr \/>\n<p>\u307e\u3041\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u306b\u305b\u3088\u9759\u7684\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u305b\u3088\u9053\u5177\u7bb1\u306e\u5074\u9762\u304c\u5f37\u3044\u3002<br \/>\u3068\u3053\u308d\u304c\u9759\u7684\u5909\u6570\u3068\u3044\u3046\u306e\u3082\u3042\u308b\u3002<br \/>\u305f\u3060\u3001\u3053\u308c\u3082\u9053\u5177\u7bb1\u7684\u306a\u4f7f\u3044\u65b9\u3092\u3055\u308c\u308b\u3053\u3068\u306e\u65b9\u304c\u591a\u3044\u3068\u601d\u3046\u3002<br \/>readonly\u4fee\u98fe\u5b50\u3068\u9759\u7684\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3068\u547c\u3070\u308c\u308b\u3001\u30af\u30e9\u30b9\u304c\u30e1\u30e2\u30ea\u4e0a\u306b\u547c\u3073\u8fbc\u307e\u308c\u308b\u3068\u304d\u5b9f\u884c\u3055\u308c\u308b\u3082\u306e\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u3002<\/p>\n<pre>  static class foo {<br \/>    static readonly public vector i;<br \/>    static foo() { i=new vector(1, 0); }<br \/>  }<\/pre>\n<p>static\u304b\u3064readonly\u306a\u5909\u6570\u3002\u3053\u308c\u3092\u9759\u7684\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u521d\u671f\u5316\u3059\u308b\u3068\u3002<br \/>static\u306f\u4ed8\u3051\u308b\u3051\u3069\u3001public\u306f\u4ed8\u3051\u306a\u3044\u3001\u3060\u3063\u3066\u52dd\u624b\u306b\u547c\u3073\u51fa\u3055\u308c\u308b\u3082\u306e\u3060\u304b\u3089\u3002<br \/>\u3053\u308c\u306f\u666e\u901a\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3068\u306f\u7121\u95a2\u4fc2\u306a\u306e\u3067\u3002<br \/>\u3053\u308c\u3092\u6d3b\u7528\u3057\u305f\u30c6\u30b9\u30c8\u3002<\/p>\n<pre>    static public void Main(string[] args) {<br \/>      Console.WriteLine(foo.i);<br \/>      foo.i.inc();<br \/>      Console.WriteLine(foo.i);<br \/>    }<\/pre>\n<p>foo.i.inc();\u3067foo.i\u306e\u5024\u3092\u6539\u5909\u3057\u3088\u3046\u3068\u601d\u3063\u305f\u304c\u306a\u305c\u304b\u5909\u308f\u3089\u306a\u3044\u3002<br \/>\u304d\u3061\u3093\u3068readonly\u306e\u52b9\u679c\u306f\u3042\u308b\u3088\u3046\u3060\u3002<br \/>\u305f\u3060\u3057\u3001\u3053\u308c\u306fvector\u304c\u69cb\u9020\u4f53\u3001\u3059\u306a\u308f\u3061foo.i\u304c\u5024\u578b\u3067\u3042\u308b\u304b\u3089\u3002\u5024\u578b\u306f\u5909\u6570\u81ea\u4f53\u306b\u5b9f\u4f53\u304c\u5165\u3063\u3066\u308b\u3002<br \/>\u53c2\u7167\u578b\u306e\u5834\u5408\u3001readonly\u306b\u3057\u305f\u3068\u3053\u308d\u3067\u3001\u53c2\u7167\u3059\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5185\u5bb9\u306f\u52dd\u624b\u306b\u6539\u5909\u3067\u304d\u308b\u3002<br \/>\u3053\u3053\u304b\u3089\u8003\u3048\u308b\u306b\u3001\u5b9a\u6570\u7684\u306a\u3082\u306e\u306f<br \/>\u25cf\u4e00\u6642\u7684\u304b\u3001public\u3067\u3082\u03c0\u30fbe\u306a\u3069\u306e\u4e0d\u5909\u306a\u6570\u5024\u30fb\u6587\u5b57\u30fb\u6587\u5b57\u5217\u306e\u5b9a\u6570 : const<br \/>\u25cf\u5909\u308f\u308b\u304b\u3082\u77e5\u308c\u306a\u3044\u6570\u5024\u30fb\u6587\u5b57\u30fb\u6587\u5b57\u5217\u306e\u5b9a\u6570\u3001\u6570\u5024\u30fb\u6587\u5b57\u4ee5\u5916\u306e\u5024\u578b\u306e\u5b9a\u6570 : readonly\u306a\u9759\u7684\u5909\u6570<br \/>\u25cf\u53c2\u7167\u578b\u306e\u5b9a\u6570 : get\u306e\u307f\u306e\u9759\u7684\u30d7\u30ed\u30d1\u30c6\u30a3<br \/>\u307e\u3041const\u306e\u4f7f\u3044\u9053\u3068\u3044\u3046\u306e\u306f\u5b9f\u306b\u72ed\u304f\u3066\u3001\u666e\u901a\u306f\u30e1\u30bd\u30c3\u30c9\u306e\u4e2d\u306e\u4e00\u6642\u7684\u306a\u5b9a\u6570\u3067\u3042\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3088\u306d\u3002<br \/>\u305f\u3068\u3048\u4e0d\u5909\u3060\u3068\u3057\u3066\u3082\u30013\u3068\u304b0.3\u3068\u304b&#8217;a&#8217;\u3068\u304b&#8221;Hello&#8221;\u3068\u304b\u3044\u3046\u3082\u306e\u3057\u304bconst\u306b\u3067\u304d\u306a\u3044\u3002<br \/>\u7d50\u5c40\u4fbf\u5229\u306a\u306e\u306f\u9759\u7684\u30d7\u30ed\u30d1\u30c6\u30a3\u3060\u3068\u601d\u3063\u3066\u305f\u308f\u3051\u3060\u3002<br \/>\u307e\u3041\u3057\u304b\u3057\u3001readonly\u306a\u9759\u7684\u5909\u6570\u3068\u3044\u3046\u306e\u3082\u3042\u308a\u3060\u3068\u306f\u601d\u3063\u305f\u3002<br \/>\u3051\u3069\u305d\u3093\u306a\u306b\u69cb\u9020\u4f53\u306f\u4f7f\u308f\u306a\u3044\u304b\u3089\u306d\u3002\u3042\u3068\u3001readonly\u3068\u306f\u3044\u3048\u5909\u6570\u3068\u306f\u306d\u3047\u3002<\/p>\n<hr \/>\n<p>\u3068\u3001\u307e\u3041\u5b9a\u6570\u7684\u306a\u4f7f\u3044\u9053\u3092\u66f8\u3044\u3066\u304d\u305f\u308f\u3051\u3060\u3051\u3069\u3001<br \/>\u5b9f\u306f\u5927\u57df\u5909\u6570\u3068\u3057\u3066\u306e\u5f79\u76ee\u3082\u679c\u305f\u3059\u3068\u3002<br \/>\u3057\u304b\u3057\u3001\u5927\u57df\u5909\u6570\u306a\u3093\u3066\u4eca\u306e\u6642\u4ee3\u6d41\u884c\u308a\u307e\u305b\u3093\u3088\u3002<br \/>\u901a\u3057\u756a\u53f7\u3092\u4f5c\u308b\u306e\u306b\u4f7f\u3048\u308b\u3068\u3044\u3046\u4f8b\u3082\u3042\u308b\u3051\u3069\u3001<br \/>\u5b9f\u969b\u306f\u901a\u3057\u756a\u53f7\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u30fc\u30af\u30e9\u30b9\u3092\u4f5c\u3063\u3066\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u305a\u3063\u3068\u4f7f\u3044\u7d9a\u3051\u308b\u306e\u304c\u3044\u3044\u3002<br \/>\u968f\u5206\u4e0b\u54c1\u306a\u3084\u308a\u65b9\u3067\u3059\u3002\u307e\u3041\u3057\u304b\u3057\u3001\u3053\u3046\u3044\u3046\u8003\u3048\u3082\u3067\u304d\u308b\u3002<br \/>\u305d\u306e\u5927\u57df\u5909\u6570\u7684\u306a\u9759\u7684\u5909\u6570\u3092private\u306b\u3057\u3066\u3001\u7279\u5b9a\u306e\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u304b\u3089\u3057\u304b\u4f7f\u308f\u306a\u3044\u3068\u3002<br \/>\u305d\u3046\u3059\u308c\u3070\u3001\u5916\u304b\u3089\u898b\u3066\u308c\u3070\u3001\u306a\u3093\u304b\u91cd\u306a\u3089\u306a\u3044\u756a\u53f7\u3092\u4f5c\u3063\u3066\u304f\u308c\u3066\u308b\u3089\u3057\u3044\u3068\u3002<br \/>\u306a\u3089\u8ab0\u3082\u6c17\u306b\u3057\u306a\u3044\u3068\u3002\u5225\u306b\u5909\u306a\u756a\u53f7\u304c\u6765\u3066\u3082\u91cd\u306a\u3089\u306a\u3044\u306a\u3089\u3044\u3044\u304b\u3068\u3002<br \/>\u591a\u5c11\u306f\u307e\u3057\u306a\u6c17\u304c\u3059\u308b\u3002\u307e\u3041\u305d\u308c\u306b\u3057\u3066\u3082\u3001\u6c17\u6301\u3061\u60aa\u3044\u3067\u3059\u3051\u3069\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C#\u306e\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u306a\u305c\u304b\u30af\u30e9\u30b9\u306b\u5c5e\u3055\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002\u305d\u3093\u306a\u306e\u306f\u3042\u3093\u307e\u308a\u6c17\u306b\u3059\u308b\u3053\u3068\u3067\u306f\u306a\u3044\u3057\u3001Java\u3067\u3082\u305d\u306e\u306f\u305a\u3002\u307e\u3041C#\u306e\u30eb\u30fc\u30eb\u3092\u4e71\u3055\u306a\u3044\u305f\u3081\u4fbf\u5b9c\u4e0a\u30af\u30e9\u30b9\u306b\u5c5e\u3057\u3066\u3044\u308b\u3068\u3001\u305d\u3046\u8003\u3048\u308b\u306e\u304c\u59a5\u5f53\u3067\u3057\u3087\u3046\u3002\u3059\u3079\u3066\u306e\u30e1\u30bd\u30c3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1358","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/1358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1358"}],"version-history":[{"count":0,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/1358\/revisions"}],"wp:attachment":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}