Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎÊ´ð£º

jspÒ³Ãæ»ñÈ¡sessionµÄÎÊÌâ - Java / Java EE

ÎÒÔÚjspÒ³Ãæ´æÉÏÒ»¸ösession,±¾Ò³Ã滹¿ÉÒÔÈ¡³öÖµÀ´.
µ«ÊÇһˢÐÂ,»òÕß´ò¿ªÐµÄÒ³Ãæ¾ÍÈ¡²»³öÖµÀ´ÁË.
Ææ¹ÖµÄÊÇ,ÎÒ²âÊÔÁíÒ»¸ö³ÌÐòʱºò
ÔÚjspÒ³Ãæ´æÉÏÒ»¸ösession,±¾Ò³Ãæ¿ÉÒÔÈ¡³öÖµÀ´,ˢлò´ò¿ªÐÂÒ³ÃæÖµÄÜÈ¡³öÀ´ÁË.
......

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

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

Java Lucene ÖÐimportµÄÎÊÌâ

ÎÒÏëʹÓÃLuceneµÄ´úÂ룬·¢ÏÖÒªimportÒ»ÅúÎļþ£º
============
import org.apache.lucene.analysis.standard.StandardAnalyzer;

import org.apache.lucene.document.Document;
¡­¡­¡­¡­¡­¡­
===== ......

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

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


ְλE601£ºJava ¹¤³Ìʦ£¨Web ¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ