·ÖÏí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ѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
Ä¿Ç°ÒªÕÒ¸öÃâ·ÑµÄjava¿Õ¼ä²»ÈÝÒ×°¡£¬´ó²¿·Ö¶¼ÊÇphp aspµÄ£¬ÍƼö´ó¼ÒÒ»¸ö·Ç³£°ôµÄÃâ·Ñjava·þÎñÆ÷£¬googleµÄappengine »¹ÄÜÃâ·Ñ´´½¨ÓòÃû¡£±ÈÈçÎÒµÄwoyaopipi, ºó׺×Ô¶¯±ä³Éwoyaopipi.appspot.com£¬Õâ¸öƽ̨ºÃ´¦¾ÍÊÇgoogleµÄ·þÎñÆ÷£¬ÐÔÄÜ¿ÉÏë¶øÖª£¬»¹ÌṩÁËmemcacheÄڴ滺´æ£¬³Ö¾Ã»¯Êý¾Ý¿âÖ»ÐèÒª½«java bean persistenÒ» ......
Îҷdz£ÐÒÔËÄÜä¯ÀÀÕâƪ¶ÔËùÓÐ(»ù±¾ÉÏÊÇÈ«²¿) Java ¿ªÔ´±¨±íµÄ Tools. Õª×Ô£ºhttp://www.open-open.com/19.htm
Openreports
OpenReportsÌṩ»ùÓÚweb
µÄÁé»î±¨±í½â¾ö·½°¸£¬Í¨¹ýä¯ÀÀÆ÷×Ô¶¯Éú³É¶¯Ì¬PDF, XLS, HTML, CSVºÍChart±¨±í¡£ÀûÓõ½µÄ¿ªÔ´¼¼ÊõÓÐHibernate, Veloctiy, Webwork¡£
¸ü¶àOpenreportsÐÅÏ¢
JFr ......
java exception ½â¾ö·½°¸ - ÎÒµÄÒì³£Íø|Òì³£|exception|myexception 831 - ActionMessages 832 - could not instantiate id generator 833 - javax.servlet.jsp.JspException 834 - javax.naming.NoInitialContextException 835 - net.sf.hibernate.HibernateException 836 - org.hibernate.exception.GenericJDBCExceptio ......
package com.test.common;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Date;
import java.util.Properties;
......