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

java¹¤³§Ä£Ê½

    java¹¤³§Ä£Ê½µÄѧϰ£¬³õÆÚµÄʱºòÔÚÍøÉϲéÁ˺ܶàÀý×Ó£¬×Ô¼ºÊ¼ÖÕÖ»Äܹ¹½¨¼òµ¥¹¤³§£¬ºóÀ´ÖÕÓÚÕÒµ½ÁËÏÂÃæÕâ·ÝÎĵµ²Å¶Ô¹¤³§Ä£Ê½ÓÐÁËÒ»¸öÈ«ÃæµÄÀí½â£¬²¢ÇÒΪ´ËÎĵµµÄ³éÏ󹤳§ÌṩÁËʵÀý£º
JAVA¹¤³§Ä£Ê½
¿´ÁËÕâô¶à¹ØÓÚ¹¤³§Ä£Ê½µÄ½²½â£¬»¹ÊǾõµÃÕâƪÎÄÕ½²µÄºÃÀí½â£¬Ìù³öÀ´ºÍ´ó¼Ò·ÖÏí·ÖÏí¡£
Ò»¡¢Òý×Ó
             »°ËµÊ®ÄêÇ°£¬ÓÐÒ»¸ö±©·¢»§£¬Ëû¼ÒÓÐÈýÁ¾Æû³µ——Benz±¼³Û¡¢Bmw±¦Âí¡¢Audi°ÂµÏ£¬»¹¹ÍÁË˾»úΪËû¿ª³µ¡£²»¹ý£¬±©·¢»§×ø³µÊ±×ÜÊǹֵֹģºÉÏBenz³µºó¸ú˾»ú˵“¿ª±¼³Û³µ£¡”£¬×øÉÏBmwºóËû˵“¿ª±¦Âí³µ£¡”£¬×øÉÏAudi˵“¿ª°ÂµÏ³µ£¡”¡£ÄãÒ»¶¨Ëµ£ºÕâÈËÓв¡£¡Ö±½Ó˵¿ª³µ²»¾ÍÐÐÁË£¿£¡
             ¶øµ±°ÑÕâ¸ö±©·¢»§µÄÐÐΪ·Åµ½ÎÒÃdzÌÐòÉè¼ÆÖÐÀ´Ê±£¬»á·¢ÏÖÕâÊÇÒ»¸öÆÕ±é´æÔÚµÄÏÖÏó¡£ÐÒÔ˵ÄÊÇ£¬ÕâÖÖÓв¡µÄÏÖÏóÔÚOO£¨ÃæÏò¶ÔÏó£©ÓïÑÔÖпÉÒÔ±ÜÃâÁË¡£ÏÂÃæ¾ÍÒÔJavaÓïÑÔΪ»ù´¡À´ÒýÈëÎÒÃDZ¾ÎĵÄÖ÷Ì⣺¹¤³§Ä£Ê½¡£
¶þ¡¢·ÖÀà
            ¹¤³§Ä£Ê½Ö÷ÒªÊÇΪ´´½¨¶ÔÏóÌṩ¹ý¶É½Ó¿Ú£¬ÒԱ㽫´´½¨¶ÔÏóµÄ¾ßÌå¹ý³ÌÆÁ±Î¸ôÀëÆðÀ´£¬´ïµ½Ìá¸ßÁé»îÐÔµÄÄ¿µÄ¡£
¹¤³§Ä£Ê½ÔÚ¡¶JavaÓëģʽ¡·ÖзÖΪÈýÀࣺ
1£©¼òµ¥¹¤³§Ä£Ê½£¨Simple Factory£©
2£©¹¤³§·½·¨Ä£Ê½£¨Factory Method£©
3£©³éÏ󹤳§Ä£Ê½£¨Abstract Factory£©
             ÕâÈýÖÖģʽ´ÓÉϵ½ÏÂÖð²½³éÏ󣬲¢ÇÒ¸ü¾ßÒ»°ãÐÔ¡£
             GOFÔÚ¡¶Éè¼Æģʽ¡·Ò»ÊéÖн«¹¤³§Ä£Ê½·ÖΪÁ½Àࣺ¹¤³§·½·¨Ä£Ê½£¨Factory Method£©Óë³éÏ󹤳§Ä£Ê½£¨Abstract Factory£©¡£½«¼òµ¥¹¤³§Ä£Ê½£¨Simple Factory£©¿´Îª¹¤³§·½·¨Ä£Ê½µÄÒ»ÖÖÌØÀý£¬Á½Õß¹éΪһÀà¡£
Á½Õß½Ô¿É£¬ÔÚ±¾ÎÄʹÓá¶JavaÓëģʽ¡·µÄ·ÖÀà·½·¨¡£ÏÂÃæÀ´¿´¿´ÕâЩ¹¤³§Ä£Ê½ÊÇÔõôÀ´“Öβ¡”µÄ¡£
Èý¡¢¼òµ¥¹¤³§Ä£Ê½
¼òµ¥¹¤³§Ä£Ê½Óֳƾ²Ì¬¹¤³§·½·¨Ä£Ê½¡£ÖØÃüÃûÉϾͿÉÒÔ¿´³öÕâ¸öģʽһ¶¨ºÜ¼òµ¥¡£Ëü´æÔÚµÄÄ¿µÄºÜ¼òµ¥£º¶¨ÒåÒ»¸öÓÃÓÚ´´½¨¶ÔÏóµÄ½Ó¿Ú¡£
       ÏÈÀ´¿´¿´ËüµÄ×é³É£º
         1) ¹¤³§Àà½ÇÉ«£ºÕâÊDZ¾Ä£Ê½µÄº


Ïà¹ØÎĵµ£º

javaÖжÁÈ¡ÎļþµÄ·½Ê½

¾­³£Óöµ½javaÖжÁÈ¡ÎļþµÄ·½Ê½£¬ÓÐʱºòÐèÒªÖ¸¶¨±àÂ룬ÓÐʱºò²»ÐèÒªÖ¸¶¨±àÂ룬±»¸ãµÄͦÔεģ¬³éʱ¼äÕûÀíÁËÒ»ÏÂjava¶ÁÈ¡ÎļþµÄ·½Ê½£¬Ö÷ÒªÊǶÔ×Ö·ûÐ͵Ĵ¦Àí£¬¶þ½øÖƵÄÔÝʱ²»¿¼ÂÇ¡£
1.readFile·½·¨£¬Ö÷Òª²ÉÓÃFileReaderÀ´¶ÁÈ¡Îļþ£¬²»ÄÜÖ¸¶¨±àÂë
2.readFileByInputStream·½·¨£¬²ÉÓÃInputStreamReaderÀ´¶ÁÈ¡Îļþ£¬¿ÉÒÔÖ¸¶¨±àÂë ......

htmlÌØÊâ×Ö·ûת»»£¨java£©

/**
* °ÑÎı¾±àÂëΪHtml´úÂë
* @param target
* @return ±àÂëºóµÄ×Ö·û´®
*/
public static String htmEncode(String target)
{
StringBuffer stringbuffer = new StringBuffer();
int j = target.length();
for (int i = 0; i < j; i++)
......

CÓïÑÔȤζ³ÌÐò£¨²»µ½£©°ÙÀý Ö®JavaʵÏÖ

package zzq.main;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
/************************************************************************
* CÓïÑÔȤζ³ÌÐò£¨²»µ½£©°ÙÀý-Ö®JavaʵÏÖ
*
* 0 ......

java×Ö·û´®Ìæ»»£º´óСдÃô¸ÐºÍ²»Ãô¸Ð£¬Ò»¾ä´úÂë½â¾ö

 public static void replaceString(String a,String b,String c){
          System.out.println(a);
          String result = a.replaceAll("(?i)"+b, c); //´óСд²»Ãô¸Ð
 
      ......

java UnicodeÓëÖÐÎÄ»¥»»

static String string2Unicode(String s) {
try {
StringBuffer out = new StringBuffer("");
byte[] bytes = s.getBytes("unicode");
for (int i = 2; i < bytes.length - 1; i += 2) {
out.append("u");
String str = Integer.toHexString(bytes[i + 1] & 0xff);
f ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ