JavaµÄµ¥ÀýģʽÀý×Ó
1. ÏÈдһ¸öSingletonµÄclass
package stone;
public class Singleton {
private static Singleton instance;
private Singleton() {}
public static Singleton getInstance(){
if(instance==null)
instance= new Singleton();
return instance;
}
}
2. ÔÙдһ¸öTestSingletonµÄclass
package stone;
public class TestSingleton {
public static void main(String[] args) {
Singleton s1=Singleton.getInstance();
Singleton s2=Singleton.getInstance();
if(s1==s2)
System.out.println("s1=s2");
else
System.out.println("s1<>s2");
}
}
3. ÔËÐÐTestSingleton, ½á¹ûÈçÏÂ:
s1=s2
4. ²âÊÔµ¥Àýģʽ³É¹¦.
Ïà¹ØÎĵµ£º
1. ÔÚJ2SE5.0ÖÐÒª¶¨Òåö¾ÙÀàÐÍÊÇʹÓÃenum¹Ø¼ü´Ê£¬Ã¶¾ÙÀàÐÍÖ÷ÒªÌṩһЩ³£Êý¡£ÈçÏÂÁдúÂ붨ÒåÁËActionö¾ÙÀàÐÍ£º
1. ÔÚJ2SE5.0ÖÐÒª¶¨Òåö¾ÙÀàÐÍÊÇʹÓÃenum¹Ø¼ü´Ê£¬Ã¶¾ÙÀàÐÍÖ÷ÒªÌṩһЩ³£Êý¡£ÈçÏÂÁдúÂ붨ÒåÁËActionö¾ÙÀàÐÍ£º
Java´úÂë
public enum Action
{
TURN_LEFT,
TURN_RIGHT,
......
http://developer.51cto.com/art/201001/180400.htm
ÎÄÀ´×ÔCSDN²©¿Í£¬ÔÎıêÌâΪ¡¶Hibernate Ö®¸¸£ºÊÇʱºòÉý¼¶µ½Java EE 6ÁË¡·¡£
Hibernate Ö®¸¸Gavin King½¨Ò鿪·¢ÕßÉý¼¶µ½ Java EE 6 ƽ̨£¬²¢Ö¸³ö£¬Ä¿Ç°¸÷ÖÖ²»Ô¸ÒâÉý¼¶µÄ¹ÛµãÆäʵÊÇûÓиù¾ÝµÄ¡£
Java EE 6 ·¢²¼ºó£¬ÎÒ¿´µ½Á˺ܶ෴¶ÔÉý¼¶µ½ÐÂƽ̨µÄ¹Ûµã¡£ÕâЩ·´¶Ô¹Ûµã´ó ......
http://developer.51cto.com/art/200906/130976.htm
JSF 2.0
¾¡¹Ü Java ÔÚչʾ²ã¿ò¼ÜÉϾºÕùµÄ·Ç³£¼¤ÁÒ£¬µ« JSF ÈÔÈ»¹ÌÊØ×Å×Ô¼ºµÄÁìµØ¡£ËäÈ»Óкܶà¹ØÓÚ JSF µÄÒ×ÓÃÐԺͽ¡×³ÐÔµÄÖÊÒÉÉù£¬µ« JSF2.0 ¾ÍÊÇΪÕýÃæ½â¾öÕâЩÎÊÌâ¶øÌá³öÀ´µÄ£¬ËüµÄÒ×Ó㬴´ÐÂÒÔ¼°¿ÉÀ©Õ¹µÄÌØÐÔ°üÀ¨£º
JSF Õýʽ½« Facelets ×÷ΪÊÓͼ¼¼Êõ¡£Ò²ÐíÄã²»ÊìÏ ......
import javax.swing.JOptionPane;
public class San {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
&n ......