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

¹ØÓÚJavaÖÐÒ»¸öclassµÄcontractÖ¸µÄÊÇʲô

rt
ÊÇconstract°Ñ£¡¹¹Ôì·½·¨£¡

¹þ¹þ LZд´íÁË

construct ¹¹Ôì,½¨Ôì,Ïë³ö
constract ºÏͬ

ͨ³£ÓÃconstructor ˵ÊÇ ¹¹ÔìÆ÷,¹¹Ô캯Êý


contract°É,¾ÍÊÇpublicÐÞÊεĶ«Î÷(Ò»°ãÊÇ·½·¨°É),¾ÍÊǶÔÍâ³ÐŵµÄ½Ó¿Ú.

ѧϰѧϰ....

¶÷£¬ÎÒ¿´µÄÊÇÓ¢ÎİæµÄJavaÊ飬ÀïÃæµÄÓÐЩ´Ê»ãÓÃ×ֵ䷭Òë²»¶ÔµÄ£¬Ö»ÄÜÎʸ÷λ´óÏÀÁË

construct ¶ÔÀà±¾ÉíÀ´ËµÊÇ×öЩ ³õʼ»¯ ¹¤×÷£¬
¶ÔÓÚ ÓÃËüµÄÀà ÊÇ ÔÚ¶ÑÉÏ´´½¨¶ÔÏ󡣡£¡£

ÕÒµ½Ò»¸öÍêÕûµÄcontract½âÊÍ£¬²»¹ý»¹ÊÇÓе㲻Ã÷°×
Object-oriented programming strictly separates the notion of what is to be done from how it is done. "What" is described as a set of methods (and sometimes publicly available data) and their associated semantics. This combinationmethods, data, and semanticsis often described as a contract between the designer of the class and the programmer who uses it because it says what happens when certain methods are invoked on an object. This contract defines a type such that all objects that are instances of that type are known to honor that contract.

A common assumption is that the methods declared in a class are its entire contract. The semantics of those operations are also part of the contract, even though they may be described only in documentation. Two methods may have the same name and parameters and throw the same exceptions, but they are not equivalent if they have different semantics. For example, not every method called print can be assumed


Ïà¹ØÎÊ´ð£º

javaÈçºÎ¿ØÖÆÔ¶³ÌLinuxÖØÆô

ÎÒĿǰÔÚ±¾µØµÄlinuxÉÏдÁËÒ»¸öswingµÄ½çÃæ£¬Ïëͨ¹ýÕâ¸ö½çÃæÀ´¿ØÖÆÆäËüµçÄÔµÄlinuxÖØÆô¡£
ÎÒÖªµÀÓÃRuntime.getRuntime().exec("shutdown -r");¿ÉÒÔ¿ØÖƱ¾»úLinuxÖØÆô£¬µ«ÊÇÔõô¿ØÖÆÔ¶³ÌµÄlinuxÖØÆôÄØ£¿ ......

¹ØÓÚjspÂÛ̳ - Java / Web ¿ª·¢

ÎÒÏÖÔÚÏëÓÃsshÕûºÏÀ´×öÒ»¸öÂÛ̳£¬µ«Êý¾Ý¿â·½Ãæ²»ÐУ¬ÎÒÖ÷Òª²»»áÉæ¼°Êý¾Ý¿â£¬²»ÖªµÀ·¢Ìû±í£¬ºÍ»ØÌû±íÒªÈçºÎÉè¼ÆºÍÇø·Ö¡£²»ÖªµÀË­ÓÐÒ»¸ö¼òµ¥µÄ˼·£¬À´Éè¼ÆÕâЩ±í¡£Ð»Ð»ÁË¡£
·¢ÌûºÍ»ØÌûÓÃͬһÕÅ±í ¡£·¢Ìû id user ......

JAVA×Ö·ûÁ÷ÎÊÌâ

×Ö·ûÁ÷µÄ¶ÁºÍд×îÖÕÔڵײ㶼ÊÇͨ¹ý×Ö½ÚÁ÷À´Íê³ÉµÄÂ𣿡¡¶ÁдÎı¾Îļþ×Ö·ûÁ÷Ó¦¸Ã¾Í¿ÉÒÔÁ˰ɡ£¡£
¸÷λ´ó¸ç´ó½ã°ï°ïæ°¢

JavaÁ÷°üÀ¨×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷£¬×Ö½ÚÁ÷ͨ¹ýIOÉ豸ÒÔ×Ö½ÚÊý¾ÝµÄ·½Ê½¶ÁÈ룬¶ø×Ö·ûÁ÷ÔòÊÇͨ¹ý×Ö½ÚÁ÷ ......

ÕÐÆ¸È«Ö°¡¢¼æÖ°JAVA¿ª·¢¹¤³Ì

´ó¼ÒºÃ£¬ÎÒÃǽüÆÚÕÐÆ¸È«Ö°¡¢¼æÖ°¿ª·¢¹¤³Ìʦ£¬È«Ö°¹¤³Ìʦ¹¤×÷µØµãÖ÷ÒªÊÇÉîÛÚ£¬¼æÖ°¹¤³Ìʦ±¾ÈË¿ÉÔÚÉîÛÚ£¬Ò²¿ÉÒÔÔÚÒìµØÍ¨¹ýÔ¶³ÌЭͬ¿ª·¢µÄ·½Ê½¿ªÕ¹¹¤×÷£¬ºÏ×÷·½Ê½¿É¹²Í¬É̶¨¡£


ְλE601£ºJava ¹¤³Ìʦ£¨Web ¿ ......

ÔõôÓÃJavaʵÏÖ¶¨Ê±Ö´ÐÐij³ÌÐò - Java / Java SE

ÎÒÏëÓÃJavaдһ¸ö³ÌÐò£¬¾ÍÊÇÎÒÏëÔÚÔËÐдúÂëºó£¬ÔÚÖ¸¶¨µÄʱ¼ä´ò¿ªÄ³³ÌÐò£¬ÀýÈçÎÒÔËÐдúÂëºó£¬½²ÔÚ12£º00´ò¿ª"D:\Program Files\Tencent\QQ2009\Bin\QQ.exe"Õâ¸ö³ÌÐò£¬Çó¸ßÈËÖ¸µã¡£»¹ÓпÉÄܵϰÔÚÖ¸¶¨µÄʱ¼ä ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ