Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
NullPointerException å«ãã§ãããï¼ãããªã¨ãã«é ¼ãã«ãªãã®ã Java 8 ããå°å ¥ããã Optional ã§ãã ã§ãã null ã®ä»£ããã« Optional ãç©æ¥µçã«ä½¿ãã¨ã³ã¼ãã Optional ã ããã«ãªããç¹ã«æ¬¡ã®ãããªå ´åã«é¢åãããã§ãã Optional<Integer> a ãããã¨ãã a ã®å¤ãäºä¹ãããããã ãã a ã empty ã®å ´å㯠empty ãå¾ããã Optional<Double> a ãããã¨ãã a ã®å¹³æ¹æ ¹ãè¨ç®ãããããã ãã a ã empty ã¾ãã¯è² ã®æ°ã®å ´å㯠empty ãå¾ããããªãã Math.sqrt ãå®å ¨ã«ããï¼è² ã®æ°ã渡ã㨠empty ãè¿ãï¼é¢æ° Optional<Double> safeSqrt(double) ããããã®ã¨ãã¦èãã¦è¯ãã Optional<Integer> a ã¨
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}