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

Assert ÔÚJavaºÍGroovyÖеÄÇø±ð

¶ÔÓÚ·ÀÓùÐÔ±à³Ì¶øÑÔ£¬assertÒ»Ö±¶¼ÊǷdz£ÖØÒªµÄ¹¤¾ß¡£µ«¶ÔÓÚÊìϤ-ea²ÎÊýµÄJava³ÌÐòÔ±¶øÑÔ£¬µ±ËûÃÇ¿´µ½ËùÓÐGroovy¶ÏÑÔÎÞÂÛÊÇ·ñÓÐ-ea¶¼ÕÕÑùÖ´ÐÐʱһ¶¨»á·Ç³£À§»ó¡£
ÊÂʵÉÏ£¬GroovyµÄ¶ÏÑÔÊÇÎÞÌõ¼þ¿ªÆôµÄ£¡
¶Ô´Ë£¬¿ª·¢ÈËÔ±Roshan Dawrani×öÁËÈçϽâÊÍ£º£¨Ô­ÎÄ£©
The JDK documentation has a long chapter on assertions that talks about the disabling feature for assertions and its impact on compiling, starting the VM, and resulting design issues. Although this is fine and the design rationale behind Java assertions is clear, we feel the disabling feature is the
biggest stumbling block for using assertions in Java. You can never be sure that your assertions are really executed.
ÔÚCore Java£¨»òÕßÊÇTIJ£¿¼Ç²»ÇåÁË£©À×÷ÕßÌáµ½assertionÀàËÆ“ÔÚº£±ß¿ªÈüͧҪ´øºÃÄãµÄ¿¨Í¨¾ÈÉúȦ£»Èç¹û´¬ÒѾ­ÔÚ´óº£ÖÐÑ룬¾Í°Ñ¾ÈÉúȦÈÓµôºÃÁË”¡£²»¹ý£¬ÔÚGroovyÖУ¬ÏÔÈ»ÕâÖÖ·ÀÓù´ëÊ©»áÒ»Ö±¸úËæÄãµ½´óº£µÄÈÎÒâ½ÇÂ䣨ϣÍû²»ÊǺ£µ×£©¡£
PS£ºÈç¹û×Ðϸ¿´¿´Groovy¶ÏÑÔµÄÊä³ö£¬ÄãÒ»¶¨»áÒâʶµ½Ëü¶ÔÓÚdebugÊǶàôÓÐÓãº
1: def xml = new XmlParser().parseText("x")
2: assert "y" == xml.text()
3: -----
4: output:
5:
6: assert "y" == xml.text()
7: | | |
8: | | x
9: | test[attributes={}; value=[x]]
10: false
11:
******
Quote of the day:
I didn't really say everything I said. - Yogi Berra


Ïà¹ØÎĵµ£º

JavaÉè¼ÆÄ£Ê½Ö®:IteratorÁ´±íģʽ

ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔ­Àí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËØºÍ¸ÃÔªËØµÄ½Úµã¡£
public class NodeBean implements Serializable
{
   
    private Object data; //ÔªËØ±¾Éí
    private NodeBean next; //ÏÂÒ»¸ö½Úµã
   
  &n ......

JavaÖз½·¨ÔÚÄÚ´æÖеıíʾ


½«Ä³ class ²úÉú³öÒ»¸ö instance Ö®ºó£¬´Ë class ËùÓÐµÄ instance field ¶¼»áÐÂÔöÒ»·Ý£¬ÄÇôËùÓÐµÄ instance method ÊÇ·ñÒ²»áÐÂÔöÒ»·Ý£¿´ð°¸ÊDz»»á£¬ÎÒÃÇÓÃfield±íʾ×ֶΣ¬ÓÃmethod±íʾ·½·¨£¬ÄÇô¼ÓÉÏstaticÇø·Öºó¾Í ÓÐËÄÖÖ£º
class field£ºÓÐÓÃstaticÐÞÊεÄfield
class method£ºÓÐÓÃstaticÐÞÊεÄmethod
instance fi ......

javaÉè¼ÆÄ£Ê½Ò»¿ú1

  Design Patterns in Java
-----------------------------------------
Steven John Metsker 
William C.Wake
-----------------------------------------
¹¨²¨µÈÒë
£­£­£­£­£­£­£­£­Ò»¡¢¶þÕ¶ÁÊé¼Ç¼£­£­£­£­£­£­
ģʽÊǼ¯ÌåÖǻ۵Ľᾧ¡£Ëü¸ø³öÁËÏà¹ØÐÐÒµÖо­Ñé·á¸»µÄ´ÓÒµÕßËùÓ¦ÓõÄËùÓеĸÅÄîºÍ·½ ......

eclipse ÖÐ ¿ª·¢ java + flex ʱ ±¨ÕÒ²»µ½ flex µÄsdk

ÔÚeclipseÖÐн¨ÁËÒ»¸öwebÏîÄ¿ È»ºóÔÚwebÏîÄ¿ÖÐÏëÌí¼Óflex ¿ª·¢Ç°Ì¨¡£ÔÚwebÏîÄ¿ÃûÉϵã»÷ÓÒ¼ü ----flex project Nature  -----  Add flex project Nature    ÔÚµ¯³öµÄ¶Ô»°¿òÖÐ ÉèÖÃÈçͼ£º
È»ºó µã»÷ next
Flex WAR file £º  Ñ¡Ôñ ÄãµÄblazeds µÄ·¾¶ È»ºóµã»÷ Finish
½á¹û ÏîÄ¿ÏÔʾº ......

JAVA ÀíÂÛ×ܽá

Ò».±àд¹¹ÔìÆ÷µÄÓÐЧ׼Ôò£º       Óþ¡¿ÉÄܼòµ¥µÄ·½·¨Ê¹¶ÔÏó½øÈëÕý³£×´Ì¬£¬Èç¹û¿ÉÒԵϰ£¬±ÜÃâµ÷ÓÃÆäËû·½·¨¡£ÔÚ¹¹ÔìÆ÷ÄÚΨһÄܹ»°²È«µ÷ÓõÄÄÇЩ·½·¨ÊÇ»ùÀàÖеÄfinal·½·¨£¨Ò²ÊÊÓÃÓÚprivate·½·¨£¬ËüÃÇ×Ô¶¯ÊôÓÚfinal·½·¨£©¡£ ¶þ.Óü̳нøÐÐÉè¼ÆµÄ×¼Ôò£º     Óü̳бí´ïÐÐΪ¼äµÄ²îÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ