ã¡ã½ããã®ç·ç§°å ã¡ã½ããã®ã¿ã«ç·ç§°åãé©ç¨ããå®ç¾©ãè¡ããã¨ãåºæ¥ãã[2007-06-12] æ»ãå¤ã®åã®ç´åã«ã<ä»®åå¼æ°, ä»®åå¼æ°â¦>ããç½®ãã ããå¾ã¯ã¯ã©ã¹ã®å ´åã¨åæ§ã public static <T> T notNull(T arg1, T arg2) { T ret; if (arg1 != null) { ret = arg1; } else { ret = arg2; } return ret; } ãã®ã¡ã½ãããå¼ã³åºãå´ã¯ãã¯ã©ã¹ã®å ´åã¨ã¯ç°ãªããæ示çã«åå¼æ°ãæå®ããå¿ è¦ã¯ç¡ãã æå®ããå¼æ°ã®å¤ã«å¿ãã¦ãèªåçã«åãå¤æãããã String s = notNull("abc", "def"); //åå¼æ°ã¯String Long l = notNull(new Long(1), new Long(2)); //åå¼æ°ã¯Long int i = notNu
{{#tags}}- {{label}}
{{/tags}}