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

JavaÉè¼ÆÄ£Ê½ÏµÁн̳̣¨Ò»£©¹¤³§Ä£Ê½factory

½ñÌìºÍ´ó¼ÒÒ»ÆðѧϰJavaµÄÉè¼ÆÄ£Ê½¡£±¾È˵Äˮƽ²»ÊǺܸߣ¬ÕâϵÁÐÎÄÕÂÖ»ÊÇ×Ô¼ºÑ§Ï°µÄ¹ý³Ì£¬²¢Ï£ÍûÄÜͬ´ó¼Ò·ÖÏí¾­Ñé¡£
ÏÈ˵ÏÂÎÒ¶Ô¹¤³§Ä£Ê½µÄÀí½â£ºµ±ÎÒÃÇÐèҪij¸ö¶ÔÏóʱ£¬×îÖ±½ÓµÄ°ì·¨ÊÇ¿´µ½Õâ¸ö¶ÔÏó¾ÍÄùýÀ´¡£µ«Êǵ±¶ÔÏó·Ç³£¶àµÄʱºò£¬ÕÒÆðÀ´¾ÍºÜ²»·½±ã¡£Õâʱ¾ÍÐèÒªÒ»¸öÖнéÀ´°ïÖúÎÒÃÇÈ¡µÃÏëÒªµÄ¶«Î÷£¬Õâ¸öÖнé¾ÍÊǹ¤³§£¨factory£©¡£
¹¤³§Ä£Ê½¿É·ÖΪÈý¸ö·ÖÀࣨ¼òµ¥¹¤³§Ä£Ê½Simple Factory¡¢ ¹¤³§·½·¨Ä£Ê½Factory Method¡¢ ³éÏ󹤳§Ä£Ê½Abstract Factory£©
ÎÒÀ´Ä£ÄâÒ»¸ö³¡¾°£º¶¯ÎïÔ°¹ÜÀíԱÿÌ춼Ҫȷ±£¶¯ÎïµÄ½¡¿µ£¬È·¶¨¶¯Î。¿µµÄÒ»ÖÖ¼òµ¥·½·¨¾ÍÊÇÌýÒ»Ìý¶¯ÎïµÄ½ÐÉùÊDz»ÊÇÕý³£¡£ÕâÑù£¬¹ÜÀíÔ±¾ÍÐèÒªËæÊ±ÕÒµ½ÈÎÒ»ÖÖ¶¯ÎïÒÔÈ·¶¨¶¯ÎïµÄÇé¿ö¡£ÏÂÃæÊǶ¯ÎïÏà¹ØÀࣨÖÁÓÚ¶¯Îï԰ΪʲôÓÐèºÍ¹·´ó¼Ò¾Í²»ÒªÌ«¼Æ½ÏÁË……£©£º
interface£ºAnimal£¨¶¯ÎïµÄ½Ó¿Ú£©
package com.captain.factory;
/**
* <P>Title£º¶¯Îï½Ó¿Ú<p>
* @author ´¬³¤¹¤×÷ÊÒ
*/
public interface Animal {
void call();
}
class£ºCat£¨Ã¨£©
package com.captain.factory;
/**
* <p>Title£ºÃ¨<p>
* @author ´¬³¤¹¤×÷ÊÒ
*/
public class Cat implements Animal {
/**
* è½Ð
* @param ÎÞ
* @return void
*/
public void call() {
System.out.print("meow");
}
}

class£ºDog£¨¹·£©
package com.captain.factory;
/**
* <p>Title£º¹·<p>
* @author ´¬³¤¹¤×÷ÊÒ
*/
public class Dog implements Animal {
/**
* ¹·½Ð
* @param ÎÞ
* @return void
*/
public void call() {
System.out.print("bark");
}
}
class£ºTiger£¨ÀÏ»¢£©
package com.captain.factory;
/**
* <p>Title£ºÀÏ»¢<p>
* @author ´¬³¤¹¤×÷ÊÒ
*/
public class Tiger implements Animal {
/**
* ÀÏ»¢½Ð
* @param ÎÞ
* @return void
*/
public void call() {
System.out.print("roar");
}
}
ÏÂÃæÏȽéÉܼòµ¥¹¤³§Ä£Ê½£º
class£ºSimpleFactory£¨¼òµ¥¹¤³§£©
package com.captain.factory;
/**
* <p>Title£º¼òµ¥¹¤³§Ä£Ê½-¹¤³§Àà<p>
* @author ´¬³¤¹¤×÷ÊÒ
*/
public class SimpleFactory {
/**
* ÕÙ»½¶¯Îï
* @param s ÕÙ»½¶¯ÎïµÄÖÖÀà
* @return animal ¸ÃÖÖÀàµÄ¶¯ÎïʵÀý
*/
public static Animal search(String s){


Ïà¹ØÎĵµ£º

Java Mail send email

package com.eastpro.batch.biz;
//import javax.activation.*;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.mail.internet.*;
import javax.mail.*;
import java.io.UnsupportedEncodingException;
import java.util.*;
/**
 * Insert the type's descript ......

Îı¾ÇгýÆ÷£¨javaÈëÃÅÁ·Ï°£©

Õâ¸ö³ÌÐò·Ç³£µÄ¼òµ¥£¬Ö÷ÒªÊÇÓÃÀ´½ØÈ¡Îı¾ÖÐÏëÒªµÄÄÚÈÝ£¬»òÕßɾ³ý²¿·ÖÄÚÈÝ¡£
////////////////////////////////////////////////////////////////////////////
Ö´ÐÐSQLÓï¾ä£º
CREATE TABLE ***(
    ssf_guid           VARCHAR(32)    ......

±ÜÃâÔÚJavaÖÐʹÓÃChecked Exception

JavaµÄException·ÖΪÁ½À࣬һÀàÊÇRuntimeException¼°Æä×ÓÀ࣬ÁíÍâÒ»Àà¾ÍÊÇchecked
Exception¡£JavaÒªÇóº¯Êý¶ÔûÓб»catch´¦ÀíµôµÄchecked
Exception£¬ÐèÒª½«ÆäдÔÚº¯ÊýµÄÉùÃ÷²¿·Ö¡£È»¶ø£¬ÕâÒ»ÒªÇó³£³£¸ø³ÌÐòÔ±´øÀ´Ò»Ð©²»±ØÒªµÄ¸ºµ£¡£
ΪÁ˱ÜÃâÔÚº¯ÊýÉùÃ÷ÖÐдthrows²¿·Ö£¬ÔÚJavaÏîÄ¿ÀïÃæ³£³£¿ÉÒÔ¿´µ½ÒÔÏ´úÂëÓÃÀ´‘Í ......

Java¼¯ºÏ¿ò¼ÜʹÓÃ×ܽá

ǰÑÔ£º
±¾ÎÄÊǶÔJava¼¯ºÏ¿ò¼Ü×öÁËÒ»¸ö¸ÅÀ¨ÐԵĽâ˵£¬Ä¿µÄÊǶÔJava¼¯ºÏ¿ò¼ÜÌåϵÓиö×ÜÌåÈÏʶ£¬Èç¹ûÄãÏëѧϰ¾ßÌåµÄ½Ó¿ÚºÍÀàµÄʹÓ÷½·¨£¬Çë²Î¿´Java APIÎĵµ¡£
Ò»¡¢¸ÅÊö
Êý¾Ý½á¹¹¶Ô³ÌÐòÉè¼ÆÓÐ×ÅÉîÔ¶µÄÓ°Ï죬ÔÚÃæÏò¹ý³ÌµÄCÓïÑÔÖУ¬Êý¾Ý¿â½á¹¹ÓÃstructÀ´ÃèÊö£¬¶øÔÚÃæÏò¶ÔÏóµÄ±à³ÌÖУ¬Êý¾Ý½á¹¹ÊÇÓÃÀàÀ´ÃèÊöµÄ£¬²¢ÇÒ°üº¬ÓжԸÃÊ ......

˵һÏÂJavaÀïÃæµÄ·¾¶ÎÊÌ⣬CLASSPATHºÍSOURCEPATH


javaµÄ·¾¶ÈÃÐí¶àÈË£¬ÌرðÊdzõѧÕ߸е½ÃÔ»ó£¬ÎÒÕâÀïÔÙ½âÊÍһϡ£ÎÒÃÇ·Ö2¸ö½×¶Î£¬1ÊDZàÒë½×¶Î£¬2ÊÇÔËÐн׶Ρ£
Ò»¡¢±àÒë½×¶Î
  Õâ¸öʱºò£¬ÎÒÃÇÒªÌṩ¸ø±àÒëÆ÷µÄÓÐ2¸ö·¾¶²ÎÊý£¬µÚÒ»¸öÊÇÔ´´úÂëÔÚÄÄÀҲ¾ÍÊÇ sourcepath,µÚ¶þ¸ö¾ÍÊÇÒÀÀµµÄÀàÔÚÄÄÀҲ¾ÍÊÇ classpath
ÎÒÃÇ¿´Ò»¸öÀý×Ó
d:\temp\TestCP\d1\p1\Clas ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ