JavaÖеļ̳Ð
1.¼Ì³ÐµÄ»ù±¾¸ÅÄî
µ±¶à¸öÀàÖ®¼ä´æÔÚÏàͬµÄÊôÐԺͷ½·¨Ê±£¬ÔÚ¸¸ÀàÖж¨ÒåÕâЩÏàͬµÄÊôÐԺͷ½·¨£¬ËùÓеÄ×ÓÀàÎÞÐèÖØж¨ÒåÕâЩÊôÐԺͷ½·¨£¬Ö»ÐèҪͨ¹ýextendsÓï¾äÉùÃ÷¼Ì³ÐBaseÀà¡£
£¨1£©¼Ì³ÐµÄ¶«Î÷
a.µ±subÀàºÍbaseÀàλÓÚͬһ¸ö°üÖÐʱ£¬subÀà¼Ì³ÐbaseÀàÖÐpublic,protectedºÍĬÈÏ·ÃÎʼ¶±ðµÄ³ÉÔ±£¨°üÀ¨³ÉÔ±±äÁ¿ºÍ³ÉÔ±·½·¨£©£»
b.µ±subÀàºÍbaseÀàλÓÚ²»Í¬µÄ°üÖÐʱ£¬subÀà¼Ì³ÐbaseÀàÖеÄpublicºÍprotected·ÃÎʼ¶±ðµÄ³ÉÔ±¡£
£¨2£©Java²»Ö§³Ö¶à¼Ì³Ð
£¨3£©JavaÖ§³Ö¶à¼¶¼Ì³Ð£¬ËùÓеÄJavaÀ඼ֱ½Ó»òÕß¼ä½ÓµØ¼Ì³ÐÁËjava.lang.ObjectÀ࣬ObjectÀàÖж¨ÒåÁËËùÓÐJava¶ÔÏ󶼾ßÓеÄÏàͬÐÐΪ£¬Î»ÓÚϲãµÄ×ÓÀà»á¼Ì³ÐÉϲãËùÓÐÖ±½Ó»ò¼ä½Ó¸¸ÀàµÄÊôÐԺͷ½·¨¡£
2.·½·¨ÖØÔØ
£¨1£©Á½¸ö·½·¨µÄ·½·¨ÃûÏàͬ£»
£¨2£©·½·¨µÄ²ÎÊýÀàÐÍ£¬¸öÊý£¬Ë³ÐòÖÁÉÙÓÐÒ»Ïî²»Ïàͬ£»
£¨3£©·½·¨µÄ·µ»ØÀàÐÍ¿ÉÒÔ²»Ïàͬ
£¨4£©·½·¨µÄÐÞÊηû¿ÉÒÔ²»Ïàͬ
±àÒëÆ÷ÒÀ¿¿·½·¨ÃûºÍ²ÎÊýÇ©ÃûÀ´Çø·Öµ÷ÓÃÄĸö·½·¨£¬²ÎÊýÇ©ÃûÖ¸²ÎÊýÀàÐÍ£¬²ÎÊý¸öÊýºÍ²ÎÊý˳Ðò¡£
3.·½·¨¸²¸Ç
£¨1£©×ÓÀàÖеÄÒ»¸ö·½·¨£¬a.Ãû³Æ£¬b.·µ»ØÀàÐͺÍc.²ÎÊýÇ©ÃûÓ븸ÀàÖеÄij¸ö·½·¨µÄÃû³Æ£¬·µ»ØÀàÐͺͲÎÊýÇ©ÃûÏàÆ¥Å䣬ÄÇô£¬×ÓÀàµÄ·½·¨¸²¸ÇÁ˸¸ÀàµÄ·½·¨£» ×¢ÒâÈý¸öÌõ¼þ£ºº¯ÊýÃû£¬²ÎÊýÁбíºÍ·µ»ØÀàÐÍ
±àÒëÆ÷»áÊ×ÏÈÅжϷ½·¨µÄ·½·¨ÃûºÍ²ÎÊýÇ©Ãû£¬Èç¹ûÍêÈ«Ïàͬ£¬±àÒëÆ÷»áÈÏΪÊÇ×ÓÀà·½·¨¶Ô¸¸Àà·½·¨µÄ¸²¸Ç£¬ÕâʱÈç¹û·µ»ØÀàÐͲ»Í¬£¬»á³öÏÖ±àÒë´íÎó
£¨2£©×ÓÀ಻ÄÜËõС¸¸Àà·½·¨µÄ·ÃÎÊȨÏÞ
£¨3£©×ÓÀà·½·¨²»ÄÜÅ׳ö±È¸¸Àà·½·¨¸ü¶àµÄÒì³££¬×ÓÀà·½·¨Å׳öµÄÒì³£±ØÐëºÍ¸¸Àà·½·¨Å׳öµÄÒì³£Ïàͬ£¬»òÕßÊǸ¸Àà·½·¨Å׳öÒì³£µÄ×ÓÀà
£¨4£©Í¬Ò»¸öÀàÖеķ½·¨Ö»Äܹ»±»ÖØÔØ£¬²»Äܹ»±»¸²¸Ç
£¨5£©¸¸ÀàµÄ¾²Ì¬·½·¨²»Äܱ»×ÓÀา¸ÇΪ·Ç¾²Ì¬·½·¨£¬¸¸ÀàµÄ·Ç¾²Ì¬·½·¨Ò²²»Äܱ»×ÓÀา¸ÇΪ¾²Ì¬·½·¨¡£
£¨6£©¹ØÓÚ¾²Ì¬·½·¨£¬×ÓÀà¿ÉÒÔ¶¨ÒåÓ븸ÀàµÄ¾²Ì¬·½·¨Í¬Ãû£¬ÒÔ±ãÔÚ×ÓÀàÖÐÒþ²Ø¸¸ÀàµÄ¾²Ì¬·½·¨
ͬ¸²¸Ç¸¸ÀàµÄʵÀý·½·¨Ò»Ñù£
Ïà¹ØÎĵµ£º
C/C++
/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê4ÔÂ29ÈÕ, ÉÏÎç9:46
*/
#include <iostream>
using namespace std;
int maximum(int[], int);
int main(int argc, char** argv) {
// int sg[3][4] = {
int sg[][4] = {
{68, 77, 73, 86},
{87, 96, 7 ......
1 ËùÓÐµÄ .java|.jsp|.html|.xml Ô´Îļþ¾ùʹÓÃutf-8±àÂë¸ñʽ±£´æµ½ÏµÍ³´ÅÅÌ¡£
È磺ÔÚEclipseÖбà¼Îļþ£¬Ñ¡ÖÐÎļþ´ò¿ªÓÒ¼ü²Ëµ¥Ñ¡ÔñÊôÐÔ£¬½«Îı¾Îļþ±àÂëÉèÖÃΪÆäËû²¢Ñ¡ÔñUTF-8£»Ò²¿ÉÒÔÔÚ
Eclipse——Ê×Ñ¡Ïî——³£¹æ——ÄÚÈÝÀàÐÍÖÐÉèÖø÷ÖÖÎļþµÄȱʡ±àÂ룬ÕâÑùÒÔºóËùÓеÄÎı¾Îļþ¶¼Ê¹ÓÃÍ³Ò ......
ÀàÓëÀàÖ®¼ä´æÔÚÒÔϹØϵ£º
1¡¢ ·º»¯(Generalization)
ºÜ¼òµ¥£¬¾ÍÊÇÎÒÃdz£ËµµÄ¼Ì³Ð¡£ÊÇ˵×ÓÀà»ñµÃ¸¸ÀàµÄ¹¦ÄܵÄͬʱ£¬»¹¿ÉÒÔÀ©Õ¹×Ô¼ºµÄ¹¦ÄÜ¡£
Èçͼ:
Java´úÂëÖбíÏÖΪ£ºextends ºÍ implements
2¡¢ ÒÀÀµ(Dependency)
Á½¸öÏà¶Ô¶ÀÁ¢µÄßËßË(AºÍB)£¬µ±A¸ºÔð¹¹ÔìBʱ£¬AÓëBÐγÉÒÀÀµ¹Øϵ£¬¼´AʹÓÃB¡£
Èçͼ£º
Java´úÂëÖеıíÏÖ ......
×î½üÏîÄ¿ÖÐÓÐÐèÒªÓõ½¹É¼Û£¬ÓÚÊÇÔÚÍøÉÏÕÒÁËÒ»·¬£¬Ã»ÓÐÒ»¸öÖ±½Ó¾ÍÄÜÓõġ£×Ô¼ºÃþË÷ÁËһϣ¬ÖÕÓڸ㶨һ¸ö¹Ë´ó¼Ò²Î¿¼¡£
package test;
import java.util.Arrays;
import javax.xml.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
/**
*
* ¹¦ÄܸÅÊö£º<br>
* ......
package com.test.util;
import java.sql.*;
public class ConnectDB {
private Connection conn=null;
private PreparedStatement pt=null;
private ResultSet rs=null;
private String uname="sa";
private String upwd="sa";
private String url="jdbc:microsoft:sqlserv ......