JAVA»ù´¡ÈëÃÅ:JAVAµÄÊý¾ÝÀàÐÍ
ÏÈ¿´Ò»¶Î´úÂë
public class Hello{
public static void main(String[] args){
int i = 5 , j = 2;
System.out.println(i+j);
System.out.println(i-j);
System.out.println(i*j);
System.out.println(i/j);
}
}
±àÒëÔËÐÐÍêÉÏÃæµÄ´úÂëºó»áµÃµ½¸÷ÌõÖ¸ÁîÔËÐеĽá¹û£º7£¬3£¬10£¬2
Õâ¾ÍÊÇJAVAÀïÃæµÄ¼Ó¼õ³Ë³ýÔËË㣬Ϊʲô5³ýÒÔ2²»µÈÓÚ2.5¶øµÈÓÚ2ÄØ£¿ÕâÊÇÒòΪÕâÀï×öµÄÊÇÕûÊýµÄËÄÔòÔËË㣬5³ýÒÔ2µÄ½á¹ûÊÇ2£¬¶øÓàÊýΪ1£¬ÎÒÃÇ¿ÉÒÔÔÚÉÏÃæµÄ´úÂëÉϼÓÉÏÒ»ÌõÖ¸ÁîSystem.out.println(i%j);
ÔËÐÐÕâ¸ö½á¹û¾Í»áµÃµ½ÓàÊý 1£¬Õâ¸ö “%”Ö´ÐеÄÇóÓ࣬»òÕß½ÐÈ¡Ä£¡£
ÏëÒªµÃµ½5/2=2.5Õâ¸ö½á¹û£¬ÎÒÃÇÐèÒª¸Ä±ä¶ÔiºÍjµÄ¶¨Òå
°Ñ int i = 5 , j=2; ¸Äд³Édouble i =5 , j = 2;
ÔÙ±àÒëÔËÐÐÒ»´Î£¬»áµÃµ½ÈçϵĽá¹û: 7.0 , 3.0 , 10.0 , 2.5.
¿ÉÒÔ¿´µ½½á¹û¶¼·¢ÉúÁ˱仯£¬±ä³ÉÁË´øСÊýµãµÄ£¬ÎÒÃdzÆ֮Ϊ¸¡µãÐͳ£Á¿¡£¸úÇ°ÃæµÄÀý×ÓÒ»Ñù£¬ÎÒÃÇҲʹÓÃÁËÕâÑùµÄ¶¨Òå·½·¨
int i = 5,j = 2;
Scanner s = new Scanner(System.in);
Ç°Ãæ˵¹ý£¬ÎÒÃÇÔÚÕâÀïÊǶ¨ÒåÁËÒ»¸öScannerÀàÐ͵ÄÒýÓñäÁ¿£¬ËüÖ¸ÏòÒ»¸öScanner¶ÔÏ󣬵«ÊÇÕâÀï¸úÒÔÇ°Óе㲻һÑù£¨´ó¸ÅÊÇjavaÖнöÓеļ¸´¦²»Ò»ÑùµÄµØ·½ÁË£©£¬ÎÒÃǶ¨ÒåÁËÒ»¸öintÐ͵ıäÁ¿i£¬È»ºó°ÑËüµÄÖµ¸³³É5£¨²»ÊÇÖ¸Ïò5£©£¬ÒÔºóÓõ½ËüµÄµØ·½¾ÍÏ൱ÓÚÔÚÓÃ5×ö¼ÆËã¡£intÊÇÎÒÃdz£Óõ½°ËÖÖ»ù±¾Êý¾ÝÀàÐÍÖ®Ò»£¬Ëü±íʾÕûÊýÐÍ¡£ÔÚJAVAÖÐÒ»¹²ÓаËÖÖ»ù±¾Êý¾ÝÀàÐÍ£¬ËûÃÇ·Ö±ðÊÇ
byte¡¢short¡¢int¡¢long¡¢float¡¢double¡¢char¡¢boolean¡£
ÕûÐÍ
ÆäÖÐbyte¡¢short¡¢int¡¢long¶¼ÊDZíʾÕûÊýµÄ£¬Ö»²»¹ýËûÃǵÄÈ¡Öµ·¶Î§²»Ò»Ñù
byteµÄÈ¡Öµ·¶Î§Îª-128~127£¬Õ¼ÓÃ1¸ö×Ö½Ú£¨-2µÄ7´Î·½µ½2µÄ7´Î·½-1£©
shortµÄÈ¡Öµ·¶Î§Îª-32768~32767£¬Õ¼ÓÃ2¸ö×Ö½Ú£¨-2µÄ15´Î·½µ½2µÄ15´Î·½-1£©
intµÄÈ¡Öµ·¶Î§Îª£¨-2147483648~2147483647£©£¬Õ¼ÓÃ4¸ö×Ö½Ú£¨-2µÄ31´Î·½µ½2µÄ31´Î·½-1£©
longµÄÈ¡Öµ·¶Î§Îª£¨-9223372036854774808~9223372036854774807£©£¬Õ¼ÓÃ8¸ö×Ö½Ú£¨-2µÄ63´Î·½µ½2
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
Îҷdz£ÐÒÔËÄÜä¯ÀÀÕâƪ¶ÔËùÓÐ(»ù±¾ÉÏÊÇÈ«²¿) Java ¿ªÔ´±¨±íµÄ Tools. Õª×Ô£ºhttp://www.open-open.com/19.htm
Openreports
OpenReportsÌṩ»ùÓÚweb
µÄÁé»î±¨±í½â¾ö·½°¸£¬Í¨¹ýä¯ÀÀÆ÷×Ô¶¯Éú³É¶¯Ì¬PDF, XLS, HTML, CSVºÍChart±¨±í¡£ÀûÓõ½µÄ¿ªÔ´¼¼ÊõÓÐHibernate, Veloctiy, Webwork¡£
¸ü¶àOpenreportsÐÅÏ¢
JFr ......
rem ¿´µ½ºÜ¶à³õѧÕß·´¸´ÎÊÕâ¸öÎÊÌ⣬дÁËÒ»¸öºÜ¼òµ¥µÄÒ»¸ö½Å±¾£¬ÓÃÓÚ×Ô¶¯ÉèÖû·¾³±äÁ¿¡£°Ñ´úÂ뿽±´£¬Áí´æΪjavaEnv.bat¡£°²×°ÍêJava 2 SDKÖ®ºó£¬¿ªÒ»¸öÃüÁîÐд°¿Ú,ÊäÈëjavaEnv java2SDKDir(java2SDKDirÊÇÄãµÄjavaµÄ°²×°Ä¿Â¼£¬²»´ø·¾¶×îºóµÄ\¡£Èç¹û°²×°Â·¾¶ÖÐÓпոñ£¬ÇëÓÃjavaEnv "java2SDKDir"¸ñʽ)²¢ÔËÐС£(×¢£ºÒ ......
Ïß³Ì Thread setDaemon ·½·¨
2009Äê07ÔÂ24ÈÕ ÐÇÆÚÎå 14:37
Thread setDaemon ·½·¨
import java.io.IOException;
/*
* ÊØ»¤Ïß³ÌÔÚûÓÐÓû§Ï߳̿ɷþÎñʱ×Ô¶¯À뿪
* ÔÚJavaÖбȽÏÌØÊâµÄÏß³ÌÊDZ»³ÆΪÊØ»¤£¨Daemon£©Ï̵߳ĵͼ¶±ðÏ̡߳£
* Õâ¸ö ......
//ÕâÊÇÎҵĶ¨Ê±Æ÷À࣬ÓÃÀ´¶¨Ê±Ö´ÐÐij¶ÎÈÎÎñ£»
package com.my.time;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
public
class
BugXmlTimer {
public
......