mirai-city.org - ãã®ã¦ã§ããµã¤ãã¯è²©å£²ç¨ã§ãï¼Â - mirai-city ãªã½ã¼ã¹ããã³æ å ±
ã¦ãã®ä¼ç¤¾ã§ãã£ã¦ã¿ã¦ã絶対æµè¡ããªãã¨æè¨ã§ããï¼
ãããªå¼ç¤¾ã¯å¤§æ(?)SIerï¼:-P
ï¼ãã¸ã¿ã«ããã¤ãã£ã¦ãããï¼æ ¼å·®ããéãï¼
常é§å ã§æ¨å¹´ä½ã£ããã¬ã¼ã ã¯ã¼ã¯ã®ä¿å®ãµã¤ãã«XOOPSç«ã¦ããã ãã©ï¼æ°å¹´åï¼èªç¤¾ã§XOOPSç«ã¡ä¸ããæã¨åããããªæè¦ã«é¥ãï¼ããã£ã¦æ¢è¦æï¼
WEB+DB PRESS vol.33
ç¹éï¼ï¼ç¹ã«ç¬¬ï¼ç« ã¯ï¼èª°ããèªãã§ã»ããï¼
ç¹é1
ãªãã¸ã§ã¯ãæåã¨ã³ã¸ãã¢å¿ èª æ§é åããã°ã©ãã³ã°å ¥é
10å¹´å ã使ããç¥èã身ã«ä»ããï¼
第1ç« ãããã¡ãã¨ã³ã¼ããæ¸ããããã®å¤§ååâ¦â¦ç¾½çç« æ´
æ§é åããã°ã©ãã³ã°åå²
第2ç« ããªãã¸ã§ã¯ãæåã«æ´»ããæ§é åã®ç¥è¦â¦â¦é»æçï¼ç¾½çç« æ´
è¿ä»£æ§é åææ³ã¨ã¯
第3ç« ããä»äºã®æµãããä»äºä¸ã®ã«ã¼ã«ããã¢ãã«åããâ¦â¦é»æçï¼ç¾½çç« æ´
æ¥åã·ã¹ãã ã®æ¬¡ä¸ä»£æ§é å
- ä½è : WEB+DB PRESSç·¨éé¨
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2006/06/22
- ã¡ãã£ã¢: 大åæ¬
- ã¯ãªãã¯: 16å
- ãã®ååãå«ãããã° (40件) ãè¦ã
ã¸ãªè²§
ãã®æ¥çï¼ã¦ãã®ä¼ç¤¾ï¼ããã¨ãå°åæ§ï¼
ã¨ã«ãããã«ãï¼ãã¾ãã®åçæ§ã®ç¡ãã«ã¡ãã£ã¨å±æ©æãè¦ããï¼
èªåã®é£ãæ¶æã¯ã©ãã«ã稼ãã¦ãããï¼ããã§ãå¹´è²¢ã®å¤ãã«ï¼ããªãèããï¼
åæ¥ä»ç¤¾ãã©ããã£ã¦åçä¸ãã¦ããã®ãæ°ã«ãªãæã ãï¼ä»æãä¼¼ããå¯ã£ãããªãã ãããï¼
åå¼ï¼æ²ããå
ç´°ãå売ï¼
Foo.class does not initialize class Foo!
Tiger(JDK1.5)ããã¯ï¼
Foo.class
ã¨ãã£ãã ãã§ã¯ï¼staticåæååã¯å®è¡ãããªããã£ã¦è©±ï¼å®éã«è©¦ãã¦ã¿ããã©ï¼æ¬å½ã«ããã ã£ãï¼ç¢ºå®ã«åæåããããã°ï¼ãClass.forName()ãã使ããªãã¨ã¤ã±ãã¤ããã ï¼
ãããªè©±ï¼èãã¦ãªãããï¼
ããã¾ã§ãã¯ã©ã¹ãªãã©ã« (Foo.class ãªã©) ãè©ä¾¡ããã¨ã¯ã©ã¹ãåæåããã¾ããã5.0 ã§ã¯åæåããã¾ãããåã®åä½ã«ä¾åããã³ã¼ãã¯æ¸ãç´ãå¿ è¦ãããã¾ãã
âOracle Technology Network for Java Developers | Oracle Technology Network | Oracle
(追è¨)ã¡ãã£ã¨èª¤è§£ãããããªã®ã§è£è¶³ãã¨ãã¾ããï¼Class.forName()ããªãã¨staticåæååãåããªãããã§ã¯ç¡ãã¹ï¼ãããªå ·åã«staticã¡ã½ããå¼ã¹ã°ï¼ãã®ç´åã«staticåæååã¯å®è¡ãããï¼
public class Main { public static void main(String[] args) { System.out.println(Foo.class); Foo.bar(); } } public class Foo { static { System.out.println("Initialization Foo..."); } public static void bar() { System.out.println("call bar..."); } }
Tigerã§ã®å®è¡çµæã¯ããï¼
$ java -cp . Main class Foo Initialization Foo... call bar...
staticåæååã®å®è¡ã¿ã¤ãã³ã°ãã¡ãã£ã¨é ããã ããªã®ã§ï¼å¤§å±ã«å½±é¿ãªãã£ã¦ãããï¼ä¸ç¨®ã®ããªãã¢ã§ããï¼ããããï¼ãã°ã¨ãåºãã¦ããï¼åºã¦ããã¿ã¤ãã³ã°ããºã¬ããããã ãããï¼
ãããï¼ãã®ã¿ã¤ãã³ã°ã®ãºã¬ãå½åãã«ãªããããªå®è£
ãã¡ãã¤ã«ã³ã ããï¼
ã£ã¦èªåã®è¸ã«æãå½ã¦ã¦ã¿ãï¼:-D
(ããã«è¿½è¨)ã©ãããï¼ãã®ä»¶ã§å°ã£ã¦ãã人ãããããã ï¼åé¡ã¨ãªã£ãã³ã¼ãã¯ï¼ã¾ã 追ãã¦ãªãï¼ï¼
âhttp://weblogs.java.net/blog/mister__m/archive/2006/08/bitten_by_the_c.html
ãã®äººï¼ã¯ã©ã¹ã®åæåãæ示ããRFE*1ãä¸ãã¦ããã®ã§ï¼ãã£ããã ããæ票ãã¨ããï¼ãã£ããããJDK7ãã使ããããã«ãªãããç¥ããªãï¼æ°ã®é·ã話ã ï¼ï¼
âBug ID: JDK-6459208 Add API for initializing a Class and checking if it has been initialized
ãâBug ID: JDK-4993813 (reflect) Need a way to force a class to be initialized.
*1:Request For Enhancement
ã¡ã¤ãªãªè©¦ã
ã®ã£ãºããã¦ã¦è¦èªæ§ã¯æªããªãï¼ã§ã欧æãã©ã³ãã¯Tahomaã¨ãVerdanaã®ã»ããè¯ãã£ããªï¼ãªãããããããã¦ãï¼