Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

·ÖÏíJavaÃæÊÔÖÐÓöµ½µÄһЩ¾­µäËã·¨ÌâÄ¿

1.дһ¸ö·½·¨£¬ÓÃÒ»¸öforÑ­»·´òÓ¡¾Å¾Å³Ë·¨±í
  /**
* ´òÓ¡¾Å¾Å³Ë·¨¿Ú¾÷±í
*/
public void nineNineMulitTable(){
for (int i = 1,j = 1; j <= 9; i++) {
System.out.print(i+"*"+j+"="+i*j+" ");
if(i==j){
i=0;
j++;
System.out.println();
}
}
}

2.¸ø¶¨Ò»¸öjava.util.Date¶ÔÏó£¬ÈçºÎת»¯Îª”2007-3-22 20:23:22”¸ñʽµÄ×Ö·û´®
/**
* ½«Ä³¸öÈÕÆÚÒԹ̶¨¸ñʽת»¯³É×Ö·û´®
* @param date
* @return str
*/
public String date2FormatStr(Date date)
{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String str = sdf.format(date);
return str;
}
3.дһ¸ö·½·¨£¬Äܹ»ÅжÏÈÎÒâÒ»¸öÕûÊýÊÇ·ñËØÊý
/**
* ÅжÏÈÎÒâÒ»¸öÕûÊýÊÇ·ñËØÊý
* @param num
* @return boolean
*/
public boolean isPrimeNumber(int num)
{
for (int i = 2; i <= Math.sqrt(num); i++) {
if(num%i==0)
{
return false;
}
}
return true;
}

4.дһ¸ö·½·¨£¬ÊäÈëÈÎÒâÒ»¸öÕûÊý£¬·µ»ØËüµÄ½×³Ë

/**
*»ñµÃÈÎÒâÒ»¸öÕûÊýµÄ½×³Ë
*@param n
*@returnn!
*/
public int factorial(int num)
{
//µÝ¹é
if(num == 1)
{
return 1;
}
return num*factorial(num-1);
}
5.дһ¸ö·½·¨£¬Óöþ·Ö²éÕÒ·¨ÅжÏÈÎÒâÕûÊýÔÚÈÎÒâÕûÊýÊý×éÀïÃæÊÇ·ñ´æÔÚ£¬Èô´æÔھͷµ»ØËüÔÚÊý×éÖеÄË÷ÒýλÖ㬲»´æÔÚ·µ»Ø-1

/**
*¶þ·Ö²éÕÒÌض¨ÕûÊýÔÚÕûÐÍÊý×éÖеÄλÖÃ(µÝ¹é)
*@param dataset
*@param data
*@param beginIndex
*@param endIndex
*@return index
*/
public int binarySearch(int[] dataset,int data,int beginIndex,int endIndex){
int midIndex = (beginIndex+endIndex)/2;
//Èç¹û²éÕÒµÄÊýÒª±È¿ªÊ¼Ë÷ÒýµÄÊý¾ÝҪС»òÕßÊDZȽ


Ïà¹ØÎĵµ£º

Java NIO APIÏê½â

 
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......

Java ¿ªÔ´±¨±í×ÛÊö

 Îҷdz£ÐÒÔËÄÜä¯ÀÀÕâƪ¶ÔËùÓÐ(»ù±¾ÉÏÊÇÈ«²¿) Java ¿ªÔ´±¨±íµÄ Tools.  Õª×Ô£ºhttp://www.open-open.com/19.htm
Openreports
OpenReportsÌṩ»ùÓÚweb
µÄÁé»î±¨±í½â¾ö·½°¸£¬Í¨¹ýä¯ÀÀÆ÷×Ô¶¯Éú³É¶¯Ì¬PDF, XLS, HTML, CSVºÍChart±¨±í¡£ÀûÓõ½µÄ¿ªÔ´¼¼ÊõÓÐHibernate, Veloctiy, Webwork¡£
¸ü¶àOpenreportsÐÅÏ¢
JFr ......

Java 2 SDK »·¾³

 
rem ¿´µ½ºÜ¶à³õѧÕß·´¸´ÎÊÕâ¸öÎÊÌ⣬дÁËÒ»¸öºÜ¼òµ¥µÄÒ»¸ö½Å±¾£¬ÓÃÓÚ×Ô¶¯ÉèÖû·¾³±äÁ¿¡£°Ñ´úÂ뿽±´£¬Áí´æΪjavaEnv.bat¡£°²×°ÍêJava 2 SDKÖ®ºó£¬¿ªÒ»¸öÃüÁîÐд°¿Ú,ÊäÈëjavaEnv java2SDKDir(java2SDKDirÊÇÄãµÄjavaµÄ°²×°Ä¿Â¼£¬²»´ø·¾¶×îºóµÄ\¡£Èç¹û°²×°Â·¾¶ÖÐÓпոñ£¬ÇëÓÃjavaEnv "java2SDKDir"¸ñʽ)²¢ÔËÐС£(×¢£ºÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ