¹ØÓÚ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
Ïà¹ØÎÊ´ð£º
ÏÖÔÚ»¹ÓкܶàÈ˸㲻¶®PHPºÍJAVA¿ª·¢µÄÐͬOAµ½µ×ÓÐʲô²»Í¬£¬¶Ô×Ô¼ºµ½µ×ÓÐʲôӰÏ죬ÒÔÖÁÓÚ×ö³öÁË´íÎóµÄÑ¡Ôñ¶øêݺ¦ÎÞÇî¡£±ÊÕ߸ù¾ÝÁ½ÖÖ¼¼ÊõµÄÌØµãÖØÐÂÕûÀíÁËÒ»¸ö¶Ô±È£¬¸ø¹ØÐÄÐͬOA¼¼ÊõµÄ¶ÁÕß×ö¸ö²Î¿¼¡£
»ªÌ춯Á¦Ð ......
ÎҵĿª·¢µÄƽ̨ÊÇMyeclipes6.0 + tomcat5.x + mysql
ÎÒËùÓеıàÂ뷽ʽ¶¼ÊÇÓõÄUTF-8
ÎÒÖ»ÓÃÁËStrtus¿ò¼Ü
ÔÚÒ»¸öformÖÐÈçÏÂÓõÄÊÇpostµÄÌá½»·½Ê½£º
<form class="form" action=&quo ......
<%@page language="java" contentType="text/html;charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="db" class="wang.connectDB"/>
< ......
ÏÖÔÚÓöµ½ÕâÑùÒ»¸öÎÊÌ⣺
ÔÚjava Öбàдswing³ÌÐò£¬ Ìí¼Ó°´Å¥jbServerStart£¬Ä¿µÄÊǵ±µã»÷jbServerStartʱ£¬³ÌÐò»á×Ô¶¯´´½¨Á½¸öÓëÆäËûÖÕ¶ËͨÐŵĶÔÏ󣬴úÂëÈçÏ£º
private Container createButtonPane ......
ÎÒµÄjava applet ǶÈëhtmlºóÎÞ·¨ÏÔʾ£¬¶øÓÃappletviewerÏÔʾÕý³£ÎªÊ²Ã´£¬»¹ÓоÍÊÇÓÃhtml converterת»¯ºó¿ÉÒÔÏÔʾ£¬ÎªÊ²Ã´£¿Çë´óÏÀ´Í½Ì£¡
HTML code:
<HTML>
<HEAD>
<TITLE>TEST.HTML< ......