2007-08-01ãã1ã¶æéã®è¨äºä¸è¦§
1.StringBufferã¯ã©ã¹ãçæããæåãä»å ãã¦ãæååãããã¡ã®å®¹éã¨ãµã¤ãºã表示ããªãã class SbAttendDemo{ public static void main(String[] args){ StringBuffer sb = new StringBuffer(); sb.append("ã¬ãã½"); System.out.println("sb is " + sâ¦
1. Characterã¯ã©ã¹ã®éçã¡ã½ããã®ä½¿ãæ¹ã示ãããã°ã©ã ãä½æããªããã class CharacterDemo{ public static void main(String[] args){ char c1 = '1'; char c2 = 'A'; char c3 = ' '; char c4 = 'a'; System.out.println(c1 + " is digit? ->\t\t" +â¦
1.2ã¤ã®Integerãªãã¸ã§ã¯ããå¥ã®ã³ã³ã¹ãã©ã¯ã¿ã«ãã£ã¦çæãããã¨ããåãæ°å¤ã表ãã¦ãããequals()ã¡ã½ããã使ã£ã¦ãã¹ãããªããã class CompareInts{ public static void main(String[] args){ Integer obj1 = new Integer(3); Integer obj2 = nâ¦
2. class ParseInt{ public static void main(String[] args){ String s = "125"; int i = Integer.parseInt(s); i += 10; System.out.println(i); } }
1. æååã®æå¾ã®10æåããæãé¨åæååã表示ããããã°ã©ã ãä½æããªããã class Last10Chars{ public static void main(String[] args){ String s = "One Two Three Four Five Six Seven"; String substring = s.substring(s.length() - 10); Systeâ¦
(1)23.45ã®å¹³æ¹æ ¹ã表示ããããã°ã©ã ãä½æããªããã class SquareRoot{ public static void main(String[] args){ System.out.println(Math.sqrt(23.45)); } } (2)2ã®12ä¹ã表示ããããã°ã©ã ãä½æããªããã class Power{ public static void main(Stâ¦
å¿ãæããã®ã§ãã®è¾ºã§ããã«ãã¾ããææ¥ã¯StringBufferã¯ã©ã¹ãããããã ãã ãããã¡ã¨ãä½æ°ã«æªç¥ã®é åã§ããææ«ãã¹ãã«åºã¦ã¾ããããå ¨ãæãªãã¦ã¤ãã¦ã¾ãããã²ãã»ã¼ãã ããããã°ããã·ã¥ã¨ããããããããåããã¾ãããªã ã¨ããããâ¦
ç·´ç¿åé¡æãã¤ãã§ã«ã½ã¼ã¹ã³ã¼ãè¨æ³ã試ãã¦ã¿ãã§ããã
ãã£ã²ãã¼ã ããããã°ãã®ããã°ã¯Javaã®åå¼·ç¨ã«ä½ã£ãäºãæãåºãã¦ãã¾ã£ãã¨ã§ããã ããæ´æ°ããæ°ã¨ããªãã£ããã ãã©ãã¼ã ãªããJavaã«ã¯ã¾ãã¾ããã ææ«ã®åå¼·ä¸ã«ãµã³ãã«ã³ã¼ããé©å½ã«æã¡è¾¼ãã§ãããæå¤ã¨æ¥½ãããã¨ãå¤æã ãã®å¤â¦