åãJavaãé¸ã°ãªãã£ãçç±
å æ¥ã大å¦æ代ã®å¾è¼©ã¨ä¹ ãã¶ãã«ä¼ã£ããå½¼ã¯Seasarã®ã³ããã¿ã«ããªã£ã¦ããã¨ã¦ãåªç§ãªJavaããã°ã©ãã ã
ãã®å½¼ãããã¼ã«ãçæã«ããå°ããã
ãã©ããã¦C#ã«ãããã§ããï¼Javaãé¸ã°ãªãã£ãçç±ã£ã¦ä½ããããã§ããï¼ã
åã¯çããã
ãJavaã«ã¯structããªããããããªãã
å½¼ã¯ããã¶ãé©ããæ§åã ã£ãã
ããã¼ã£ï¼structï¼ã»ã»ã»ãããªã«å¿ è¦ã§ãããstructï¼ã
å½¼ã¯ãããããSIã«è¿ãã¨ããã«ãã¦ãã¦ã§ãã¢ããªãªã©ã®éçºãªã©ã«ãæºãã£ã¦ãã¦ãã¨ããç«å ´ãä¸æ¹åã¯3次å CADé¢ä¿ã ãããå½¼ã¨ã¯å ¨ãéãåéã§ãã£ã¦ãããäºäººã¨ãããã°ã©ãã§ãããªããããäºãã«ç¥ããªãåéããã£ã¦ããã®ã§ãããããæ å ±äº¤æã¯ã¨ã¦ãé¢ç½ãã
ãã»ãã3次å ã®å¹¾ä½æ¼ç®ããããã¨æã£ããã座æ¨å¤(x,y,z)ãæ ¼ç´ãããæ¼ç®ãããããããããããã¯ãã«ã¯ã©ã¹ã¨ãä½ãã§ããï¼doubleã¨ãfloatã§x,y,zã®ãã£ã¼ã«ããæã£ã¦ãåç´ãªã¯ã©ã¹ãã
åããã¼ã«ã飲ã¿ãªãã説æãå§ããã
æè¿ã¯3次å 測å®æ©ã®å¿ç¨ãã©ãã©ãåºã¾ã£ã¦ãã¦ããã3次å 測å®ã¨ã¯ãã¬ã¼ã¶ã¼ãªã©ãç¨ãã¦å®ç©ã®å½¢ç¶ãã¼ã¿ãã¹ãã£ã³ãã³ã³ãã¥ã¼ã¿ã«åãè¾¼ãæè¡ã ããã®æ¸¬å®æ©ããå¾ãããã®ã¯ç¹ç¾¤ãã¼ã¿ãããªãã¡è¨å¤§ãª(x,y,z)座æ¨å¤ã®åã ã
åé¡ã¯ãã®ç¹ç¾¤ãã¼ã¿ã®ãµã¤ãºï¼å¾ããã座æ¨å¤ã®æ°ï¼ã ãæ°ç¾ä¸ç¹ã¯ã¶ã©ã§ã大ãããã®ã¯æ°åä¸ç¹ã«åã¶ãã¾ã ãã¼ã¿ãµã¤ãºã¯å¢ããå¾åã«ããããã ããåæ¨é¢ä¿ã«ãªãã¨ãã¼ã¿éã¯ç°¡åã«åãè¶ ãã¦ãã¾ãã¨èãã¦ããã
ãããã£ãåéã®å¿ç¨ãè¦éã«å ¥ããå ´åããããã®åº§æ¨å¤ã²ã¨ã¤ã²ã¨ã¤ãã¬ãã³ã¬ã«ç®¡çããããªãã¸ã§ã¯ãã¨ãã¦æ±ãã®ã¯éç¾å®çã ããã£ã¨ããéã«ã¡ã¢ãªã使ãæããã¦ãã¾ãããããã©ã¼ãã³ã¹ã«ãåé¡ãåºãã ããããããJavaã«ã¯structããªãã®ã§ããã¯ãã«ã¯ã©ã¹ãä½ã£ããããã¯ãã¼ãã«newããããªãã¸ã§ã¯ãã«ãªã£ã¦ãã¾ããããã«å¯¾ãã¦C#ã«ã¯ï¼.NETã«ã¯ï¼structãããããããåãJavaãé¸ã°ãã«C#ã«ããçç±ã ã
ã¡ãªã¿ã«ãåã¯ç°¡åãªã¡ã¢ãªã¢ãã±ã¼ã¿ã®ãããªãã®ãèªä½ãã¦ããããã¯ãã«ã®ãããªåºå®é·structã®ã³ã¬ã¯ã·ã§ã³ã«ç¹åããã°ãã¡ã¢ãªãããå¹ççã«ä½¿ããã®ã§ã¯ãªããã¨èããããã ããããä½ããã®ã¯ãC#ãunsafeã³ã¼ããæ±ããããã§ãããunsafeãã¼ã¯ã¼ãã使ãã°C/C++ã®ããã«ãã¤ã³ã¿ã使ã£ã¦ä½ä½ã®ããã°ã©ãã³ã°ãã§ããã
ããã«ããã¨ãJavaã¯æ¼ç®åã®å¤éå®ç¾©ãåºæ¥ãªãããããå¹¾ä½æ¼ç®ããããç«å ´ããã¯çª®å±æ¥µã¾ããªãããã£ã±ãããã¯ãã«ã¯ã©ã¹ãä½ã£ãã足ãç®ãå¼ãç®ã¯æ¼ç®åã§ããããããã
ã²ã¨ããã説æãçµããã¨ãå½¼ãç解ãã¦ãããããã ã£ãã
ããªãã»ã©ã»ã»ã»ãããã¯å·¥å¤«ããã°Javaã§ãåºæ¥ãªãããã§ã¯ãªãã¨æãã¾ããã§ã確ãã«ãstructã§ããèªç¶ã«è¨è¿°ã§ããããªããã®ã»ããããã§ãããã
ãã¡ãããC#ã«ã¯ä»ã«ãåªããç¹ããããããããdelegateãã©ã ãå¼ãyield returnãLINQãªã©ãããããããã¹ã¯ãããã¢ããªãéçºãã身ã¨ãã¦ã¯ .NET Framework ãå©ç¨ã§ãããã¨ãå¬ãããããããä½ã決å®çãªçç±ãã¨èãããã°ãããã¯ãã£ã±ãstructã ã¨æãã®ã ã
Java㯠"The Network is The Computer" ã®æ¨èªã®ä¸ã«éçºãããè¨èªã§ããã
ãããC#ã«ã¯ãã³ã³ãã¥ã¼ã¿ãã³ã³ãã¥ã¼ã¿ï¼è¨ç®æ©ï¼ã¨ãã¦ä½¿ããããã¨ãã層ã«ãé æ ®ããããåã«ã¨ã£ã¦ã¯ããããããã
ã»ã»ã»ã¨ãããã¾ã§æ¸ããã¨ããã§ãã¡ãã£ã¨ã°ã°ããã次ã®è¨äºãè¦ã¤ãã£ãã
ããã¦ãç§ãC#ã«ä¹ãæãã10ã®çç±ã¨ã¯ããstructããdelegateããpropertyããcustom attributeããthreadããinterfaceããvirtualã¨overrideãã#ifããVisual Studio .NETããJavaãå«ã«ãªã£ããã§ããã以ä¸ã«ãã®è©³ç´°ã示ãã
特集 私がJavaからC#に乗り換えた10の理由(1/4) - @IT
ãã®æ¹ãæåã®çç±ã« struct ãæãã¦ãã¾ããã