Java Ö±½ÓÑ¡ÔñÅÅÐò
Ö±½ÓÑ¡ÔñÅÅÐòËã·¨£º´Ó´ýÅÅÐòµÄÊý¾ÝÔªËؼ¯ºÏÖÐÑ¡È¡×îСµÄÔªËطŵ½ÔʼÊý¾ÝµÄµÚÒ»¸öÔªËصÄλÖÃÉÏ¡£È»ºó²»°üÀ¨µÚÒ»¸öÔªËصÄÊý¾ÝÔªËؼ¯ºÏÖÐÕÒµ½×îСµÄÔªËطŵ½´Ë¼¯ºÏÖУ¬ÒÀ´ÎÀàÍÆ£¬¼´¿ÉÍê³ÉÅÅÐò¡£
Ë㷨ʵÏÖÈçÏ£º
/**
* Ö±½ÓÑ¡ÔñÅÅÐò
* @param a ÓÃÓÚÅÅÐòµÄÊý×é
* */
public void selectSort(double[] a){
for(int i = 0; i < a.length -1; i ++){
int smallIndex = i;
for(int j = i;j < a.length; j ++){//ÕÒµ½×îСµÄÖµ¼°ÆäϱêλÖÃ
if(a[j] < a[smallIndex]){
smallIndex = j;
}
}
if( i != smallIndex ){//½«×îСԪËطŵ½µ±Ç°iλÖ㬽«iλÖÃÔªËطŵ½×îСԪËصÄλÖã¬Íê³É½»»»
double temp = a[i];
a[i] = a[smallIndex];
a[smallIndex] = temp;
}
}
}
Èç¹ûÿ´ÎÅÅÐòºó½«Êý¾ÝÔªËØÒÀ´ÎºóÒƾͿÉÒÔ±ÜÃâͬһԪËغóÒÆ´øÀ´µÄÅÅÐò·½Ê½²»Îȶ¨µÄÎÊÌâ¡£
Ïà¹ØÎĵµ£º
ΪÁ˽øÐзÇ×èÈûµÄsocketͨÐÅ£¬java nioÌṩChannel¸ÅÄîµÄʵÏÖ¡£Channel¸ÅÄîÒÔÇø±ðÓÚ´«Í³µÄ»ùÓÚÁ÷¸ÅÄîµÄIO¡£ÊÂʵÉÏChannel¸ÅÄîµÄIO¼È°üÀ¨·Ç×èÈûʽµÄIOÒ²°üÀ¨×èÈûʽIO¡£ÒªChannelÍê³É·Ç×èÈûʽIOÐèҪʵÏÖSelectableChannel½Ó¿Ú£¬ÓëSelector¹ØÁªÊ¹Óá£SocketChannel¾ÍÊÇÕâÑùÒ»¸öSelectableChannel¡£
ÓÉÓÚ£¬selector»úÖƱ¾ÉíÉ ......
5.
JSP
±ê×¼¶¯×÷¡¢
JSP
Ö¸ÁîÓÃÓÚÒ³ÃæÓëÈÝÆ÷¼äµÄͨÐÅ£¬¶ø
JSP
±ê×¼¶¯×÷ÓÃÓÚÒ³ÃæÓëÒ³Ãæ»òÕßÒ³ÃæÓë×é¼þ¼äµÄͨÐÅ¡£È磺
<jsp:include
page=”localURL” flush=”true”>
6.
JSP
Òþʽ¶ÔÏó
ÔÚ
......
Ò»¡¢
HTTP
ÐÒéµÄÀí½â
1.
ʲôÊÇ
HTTP
ÐÒé
HTTP
ÊÇÒ»ÖÖ³¬±¾ÎÄ´«ÊäÐÒ飬ÊÇÒ»Ì×¼ÆËã»úÔÚÍøÂçÖÐͨÐŵĹæÔò¡£ËûÊÇÒ»ÖÖÎÞ״̬µÄ´«Ê䷽ʽ¡£
2.
HTTP
ÐÒéµÄ¸ñʽ
HTTP
µÄÇëÇó£º
Ç ......
Ò»¡¢
ΪʲôҪ
Web
״̬¹ÜÀí
¶ÔÓÚÿ¸öÈÝÆ÷¶øÑÔÿ¸öÇëÇó¶¼Ï൱ÓÚÒ»¸öеĿͻ§£¬ÒòΪµ±·þÎñÆ÷Éú³É
Response
·µ»Øµ½¿Í»§¶Ë£¬ÔÚ¿Í»§¶ËÏÔʾ³öÀ´ºóÏà¶ÔÓ¦µÄ
Socket
¾Í»á¹Ø±Õ£¬ËùÒÔ
HTTP
ÐÒéÊǸöÎÞ״̬µÄÐÒ飬Ëû²»Äܱ£´æµ±Ç°Óû§µÄÐÅÏ¢¡£
¶þ¡¢
ʵÏÖ״̬¹ÜÀíµÄ·½Ê½
1.
ÔÚÍø ......
Ò»¡¢
web
µÄÈýÖÖ×÷ÓÃÓò
ServletContext(
ÉÏÏÂÎÄ
)
£ºÕû¸ö
web
Ó¦ÓóÌÐò£¬Ï̲߳»°²È«
HttpSession(
ȇȡ
)
£ºÒ»¸ö»á»°½»»¥¹ý³Ì
ServletRequest(
ÇëÇó
)
£ºÒ»´ÎÇëÇó¹ý³Ì
ÊôÐÔ²Ù×÷·½·¨£º
void setAttribute(String,Object)
......