Javaå ¥é+α
å ·è±¡åã§ã¯ãªãæ½è±¡åã§æ±ããã¤ã³ã¿ãã§ã¼ã¹ã使ããã¿ãããªã話ã«å¯¾ãã¦ã åç½®ã Javaã®è©±ãä»ã®è¨èªã ã¨è©±ã¯å¤ããã¾ãã ãããããã®ã絶対çã«æ£è§£ãã¨è¨ããã®ã§ã¯ããã¾ãããç§ã®ç¾å¨ã®é¸æã®èª¬æã§ããææ¥ã«ãªã£ããéããã¨è¨ã£ã¦ãããã 主â¦
JavaBeansã£ã¦è¨èãç®ã«ãã¦ããµã¨æ¤ç´¢ãã¦ã¿ãããã¾ãã«é ·ãã£ãã®ã§æ¸ãã¦ããããã¨ã対象ã¯ãJavaBeansã£ã¦ãªãã ãï¼ãã¨æã£ã¦ãã¾ã£ãåå¦è ãããã§ããããªäººã£ã¦ç§ã®ããã°èªããã ãããâ¦â¦ ä»å¾ã¯ããã®ã¨ã³ããªåç §ãã«ããã¤ããã§æ¸ãã¦ã¿ãâ¦
2017/5/20ã«ãã£ãJJUG CCC 2017 Springã§ç»å£ããã¦ããã ãã¾ããã 8åç®ã®åå ã§ãã æ¯åãã¯ã¼ã¢ãããã¦ãããªã¼ã¨è¨ãã®ã¯ååã®ããã°ã§ãæ¸ãã¾ããããä»åã¯ç®ã«è¦ãã¦åå 人æ°ãå¢ãããã ãªã¼ã¨ä½æãã¾ããã å ¥ããªãã»ãã·ã§ã³ãããã¾ããâ¦
Javaå ¥éã§ã¯ããã£ã¨ä»¥ä¸ã®ããã«æ¸ãããã³ã³ã¹ãã©ã¯ã¿ã§ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ãããå®è¡ãããã¨ã«ã¤ãã¦æãä¸ãã¦ã¿ã¾ãã ã³ã³ã¹ãã©ã¯ã¿ããã¤ã³ã¹ã¿ã³ã¹ã¡ã½ããã使ç¨ãããã¨ã¯å¯è½ã§ãããé¿ããã»ããç¡é£ã§ãã ã³ã³ã¹ãã©ã¯ã¿ã®å®è¡ä¸ã¯ã¤ã³ã¹ã¿â¦
Javaå ¥éã§ã¯å²æã¨ãã¦ãããã¼ã«ã«ã¯ã©ã¹ã¨ãã¤ãã§ã«é¢é£ã®å¼·ãå¿åã¯ã©ã¹ã«ã¤ãã¦æ¸ãã¦ããã¾ãããã¹ãããã¯ã©ã¹ã¨ãã¤ã³ãã¼ã¯ã©ã¹ï¼å é¨ã¯ã©ã¹ï¼ã¨ãã¯ãããããã£ããæ¸ããã¤ãããªã®ã§ãèªãã§ããã ããã¨å¬ããã§ãã Javaã¨ã³ã¸ãã¢é¤æèªæ¬â¦
ããã°ã«ã«ãã´ãªãJavaå ¥é+αããä½ã£ã¦ã¿ãã Javaå ¥é+α ã«ãã´ãªã¼ã®è¨äºä¸è¦§ - æ¥ã 常ã ã«ãã´ãªåã®éããJavaã¨ã³ã¸ãã¢é¤æèªæ¬ã®Javaå ¥éãèªãã 人ãã«å¯¾ãã¦ã+αã«ãªããããªãã®ãåé¡ãã¦ããã¾ãã Javaã¨ã³ã¸ãã¢é¤æèªæ¬ [ç¾å ´ã§å½¹ç«ã¤ææ°â¦
JavaSE8ã§è¿½å ãããjava.util.Optionalã«ã¯nullã¨ã®æ¦ãã«çµæ¢ç¬¦ãæã£ã¦ãããããã¨æã£ã¦ãããã§ãããæã£ã¦ãã ãã ã¨ä½ãèµ·ãããªãã®ã§ã使ãæ¹ã¨ãæã£ããã¨ã¨ããä¸éãæ¸ãã¦ããã¾ãã Optionalã®ãã¡ã¯ããªã¡ã½ãã Optionalã®ã¤ã³ã¹ã¿ã³ã¹ã¡â¦
Java Advent Calendar 2014 - Qiita ã®9æ¥ç®ã§ãã9æ¥ã£ãã9æ¥ã§ãã ãªããé£ããã¨ã³ããªãå¤ãä¸ã§ããã空æ°ãèªã¾ãã«è»½ãã§ããã¾ãã Javaã§ã¯è²ã ãªã³ã¼ãã®æ¸ãæ¹ãã§ãããã©ãå®éãã¾ããããªãããªã¼ã£ã¦æãã³ã¼ãã£ã³ã°ã«ã¤ãã¦ããããªãçâ¦
ä½åº¦ãæ¸ãã¦ãããã©ãæ´ççãªæå³ã§ãä»å¾ã¯ããã®ã¨ã³ããªåç §ãã«ããã¤ããã§æ¸ãã¦ã¿ãã æååé£çµããè¦ãã·ã¹ãã å ã§æ±ãåã«ã¤ã㦠- æ¥ã 常ã Javaããã°ã©ãã§ããããè¦åãã10ã®è³ªå ã«çãã¦ã¿ã - æ¥ã 常ã String ã®é£çµãã¿ã®ç¶ã - â¦
æ°ããæè¡ã使ã£ããåã£ãã³ã¼ããæ¸ãã¨ã¡ã³ãããã®ã大å¤ãæ°ããå ¥ã£ã¦ãã人ã§ãåããããã«æ¸ãå¿ è¦ãããããã®æè¦ã«å¯¾ããä¸æãåãè¿ããåºæ¥ãããã«ãªããããâ Hidariã (@Hidari0415) 2012å¹´12æ27æ¥"åã£ãã³ã¼ã"â¦â¦ã¯ã©ãã ãããã³ã¼ãâ¦
ã³ã³ãã¤ã«ã¯éããä¸å¿ã hogeã®ã»ã«ã¤hogeé§åã¯ãã¡ãâ http://hogedriven.net å ãã¿ Javaã§ã class Hoge{ void Hoge(){ Hoge Hoge = new Hoge(); Hoge.Hoge();}} ã®åHogeã¯ä½ã説æãããã®ã¯ãçµæ§å®åãã¯ãããï½2012-11-21 14:18:23 via twicli
ããã«é§å2.0ã§è©±ããå 容ã§ãã è³æ ã³ã¡ã³ãã«ã¤ãã¦èãã¦ã¿ã é·ããï¼
ä»æ¥ã¯æè²è³æã«ãããã㦠xs.size() == 0 㨠xs.isEmpty() ã®éãã«ã¤ãã¦æ°äººã®åã«ç±ãèªã£ã¦ãã¾ã£ããæè²è³æã¨éããã¨ãè¨ã£ã¦æ··ä¹±ããã¦ç³ã訳ãªã2012-09-06 22:34:07 via atig.rb @keita44_f4 ãµã¤ãºåãã¨ãä¾ãã°xsããªã¹ãã ã£ããããã¨ãâ¦
window.twttr = (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], t = window.twttr || {}; if (d.getElementById(id)) return t; js = d.createElement(s); js.id = id; js.src = "https://platform.twitter.com/widgets.js"; fjs.parenâ¦
ãããªã³ã¼ãããã£ã¦ã public class Hoge { public static void main(String[] args) { C c = new C(); c.method(); } } class A { static void method1() { System.out.println("A method1"); } void method2() { System.out.println("A method2"); } } câ¦
Collectionsããã£ã¨ç´¹ä»ãã¦ã¿ããã¨æã£ã¦ä½ã£ãã®ã§ãæãæãããã£ã¨ä¸ã®ä¸ã«ã¯è¶ 便å©ãªãã®ãããµãã¦ããã ãã©ãOSSã使ããªãã£ããããããããããã«ç¹ãããªãç°å¢ã ã£ãããè²ã ã¨çç±ããã£ã¦ãã®è¾ºãã®ã¨ã³ã·ã¹ãã *1ã使ããªãç¶æ³ã¯ããã¾â¦
List list = hoge(); if (list.size() >= 1) { for (Object o : list) { // hoge } } ã±ã£ã¨è¦ã¦ isEmpty 使ããã¨æã£ããã©ããããã if è¦ããªãâ¦ã Annotation annotation = clz.getAnnotation(HogeAnnotation.class); if (annotation != null) { // anâ¦
Java 㧠TreeSet ã« null ã add ãã㨠NullPointerException ã«ãªãã¾ãã*1 Airof:~ irof$ groovysh Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8 Groovy Shell (1.8.2, JVM: 1.6.0_26) Type 'help' or '\h' for help. -----------------------------â¦
ä½ã¨æ¯ã¹ã¦ãåãã£ã¦è¨ãã¯ã©ã¹Aããã£ã¦ã class A { @Override public boolean equals(Object obj) { return true; } } ããããã¨ï¼ Collection set = new HashSet(); Collection list = new ArrayList(); set.add(new A()); set.add(new A()); list.addâ¦
以ä¸ã®ã³ã¼ããå®è¡ãããã©ããªããã(1) Set set = new HashSet(); set.add(new Object()); set.add(new Object()); System.out.println(set.size()); (2) class A { public boolean equals(Object obj) {throw new RuntimeException();} } Set set = new â¦
EffectiveJavaèªæ¸ä¼ã§æå¤ã¨enumãã¿ã§éè¦ãããæ°ãããã®ã§ãã¡ãã£ã¨æ¸ãã¦ã¿ã¾ããå 容çã«ç®æ°ãããã®ã¯ç¡ãã¯ãã®äºãæ¸ãã¾ãã®ã§ãç解ããã¦ããæ¹ã¯ããã³ãææ¢ãã§ããã¦ãã ããã èªã¿æ¹ enum㯠enumerate ã enumeration ãèªæºã«ãªã£ã¦ãâ¦
Javaããã°ã©ãã§ããããè¦åãã10ã®è³ªå - ãããããã¹ãã¼ã"èªç§°Javaããã°ã©ããè¦åãã"ã"åé¡ãªãçãããã"ã¨ã軽ãçããã«ã¯é«ããã¼ãã«ãªæ°ããã¾ãããã©ãä»æ¥æç¹ã®ç§ã®ã¹ãããã·ã§ããã¨ãã¦æãã¦ããã¾ãã決ãã¦é²æªè¶£å³ãããããâ¦
ä¼¼ãè¨èã ããã¨è¨ãããã§ã¯ããã¾ãããããªã¼ãã¼ãã¼ãã¨åæ§ã«ãªã¼ãã¼ã©ã¤ãããã°ãã°èª¤ç¨ããã¾ãããã£ã¨ãããªã¼ãã¼ãã¼ãã®èª¤ç¨ã«æ¯ã¹ãã¨è¦ãããé »åº¦ã¯ä½ãã®ã§ãããããã¯ãªã¼ãã¼ã©ã¤ããç解ããã¦ããã¨è¨ãããããããããç¶æ¿ããã¾â¦
æ£ãã使ãæ¹ã®ãããªãéå ·ã¯å®³æªã«ãããªãã¾ããã éã¯æ£ãã使ãã°ç´ãå¸ãããããã¨åãäºãåºæ¥ããã©ãå¤ã«å¾ãããããã¨å ¨ããããªãã£ãããæ®éã®éã§éãã¤ããããåããã¨ãã¦ãæåéãæ¯ãç«ããªããããã«äººã«åãããããã¨å±éºã§ããéâ¦