java·½·¨µÄÖØÔØÓ븲¸Ç
java¶à̬µÄ2ÖÖ±íÏÖÐÎʽ ·½·¨ÖØÔغͷ½·¨¸²¸Ç
·½·¨ÖØÔØ£ºÍ¬Ò»¸öÀàÖУ¬·½·¨ÃûÏàͬ£¬²ÎÊýÁÐ±í²»Í¬µÄ2¸ö»ò¶à¸ö·½·¨¹¹³É·½·¨µÄÖØÔØ¡£
·½·¨¸²¸Ç£º×ÓÀàÖØÐÂʵÏÖÁ˸¸ÀàÖеķ½·¨¡£
·½·¨ÖØÔØ
/**
* ·½·¨ÖØÔØÂú×ãµÄÌõ¼þ
* ͬһ¸öÀàÖУ¬·½·¨ÃûÏàͬ£¬²ÎÊýÁÐ±í²»Í¬µÄ2¸ö»ò¶à¸ö·½·¨¹¹³É·½·¨µÄÖØÔØ
* ²ÎÊýÁÐ±í²»Í¬Ö¸²ÎÊýµÄÀàÐÍ£¬²ÎÊýµÄ¸öÊý£¬²ÎÊýµÄ˳ÐòÖÁÉÙÒ»Ïͬ
* ·½·¨µÄ·µ»ØÖµÀàÐÍ£¬·½·¨µÄÐÞÊηû¿ÉÒÔ²»Í¬¡£
*/
public class Overload{
public static void overLoad(int i){
System.out.println(i);
}
/* ÏÂÃæ·½·¨¶¼ÓëµÚÒ»¸ö·½·¨public static void overLoad(int i)Ïà±È½Ï*/
//public int overLoad(int k){}//´íÎ󣬲ÎÊýÁбíÏàͬ
//·µ»ØÖµÀàÐͲ»Ïàͬ
public int overLoad(int i,int k){
return 0;
}
//ÐÞÊηû²»Í¬
private void overLoad(double d){
}
//ÐÞÊηû£¬·µ»ØÖµÀàÐͶ¼²»Í¬
private double overLoad(double d,int k){
return 0;
}
}
·½·¨¸²¸Ç
/**
* ·½·¨¸²¸ÇÖ¸×ÓÀàÖØÐÂʵÏÖÁ˸¸ÀàÖеķ½·¨
* ·½·¨¸²¸ÇÔ¼ÊøÌõ¼þ£º
* 1.×ÓÀàµÄ·½·¨Ãû³Æ£¬²ÎÊýÁÐ±í£¬·µ»ØÖµÀàÐͱØÐëÓ븸ÀàÖз½·¨µÄÃû³Æ£¬²ÎÊýÁÐ±í£¬·µ»ØÖµÀàÐÍÒ»ÖÂ
* 2.×ÓÀà·½·¨²»ÄÜËõС¸¸Àà·½·¨µÄ·ÃÎÊȨÏÞ£¬µ«¿ÉÒÔÀ©´ó
* 3.×ÓÀà·½·¨²»ÄÜÅ׳ö±È¸¸Àà·½·¨¸ü¶àµÄÒì³£,¿ÉÒÔ²»Å׳öÒì³£
*/
public class Override{
}
class Exception1 extends Exception{}
class Exception2 extends Exception1{}
class Exception3 extends Exception2{}
class Parent{
void method() throws Exception2{}
}
class Son extends Parent{
//private void method(){}//´íÎó£¬ËõСÁ˸¸Àà·½·¨µÄ·ÃÎÊȨÏÞ
//int method(){} //´íÎ󣬷½·¨·µ»ØÖµÓ븸Àà·½·¨²»Ò»ÖÂ
void method(int k){} //ͨ¹ý±àÒ룬µ«²»Ó븸ÀàµÄ·½·¨method()¹¹³É¸²¸Ç
//public void method() throws Exception1{}//´íÎó Å׳ö±È¸¸Àà¸ü¶àµÄÒì³£
//public void method(){} //ÕýÈ· À©´ó¸¸Àà·½·¨µÄ·ÃÎÊȨÏÞ£¬²»Å׳öÒì³£
//void method() throws Exception3{}; //ÕýÈ· Å׳öµÄÒì³£±È¸¸ÀàÅ׳öµÄÒ쳣С
public void method() throws Exception3{}
}
Ïà¹ØÎĵµ£º
±¾ÈËÍøÉÏÊÕ¼¯µÄÁ½¸öjava
¼Òô³ÌÐò,ÎÄÕ³ö´¦²»¼ÇµÃÁË.
³ÌÐò1:
import javax.sound.sampled.*;
import javax.swing.JFrame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.Toolkit;
import javax.swing.JPanel;
import java.awt.event.ActionListener;
......
JavaÖз½·¨ÃüÃûÒ»°ãÊÇ£º¶¯´Ê/¶¯´ÊÐÔ´Ê×飬Ê××ÖĸСд£¬Öм䵥´ÊµÄÊ××Öĸ´óд£¬ÆäËü×ÖĸСд¡£
¾¡Á¿Ó¦Óüòµ¥µÄ¡¢³£Óõĵ¥´Ê£¬Ê¾Àý:
get/set first/last
add/remove& ......
ΪÁËÓ¦¸¶2009Äê11ÔÂ8ºÅ¹ã¶«µçÍøµÄ±ÊÊÔÌâÄ¿£¬ÌصØÕÒµ½Ò»ÆªJava±ÊÊÔÌâÄ¿(http://blog.csdn.net/yexianyi/archive/2009/04/25/4123350.aspx)£¬ÏÖÖØÐÂ×ªÔØÊ¹Óá£
Java±ÊÊÔÌ⼯½õ
1.MVCµÄ¸÷¸ö²¿·Ö¶¼ÓÐÄÇЩ¼¼ÊõÀ´ÊµÏÖ?ÈçºÎʵÏÖ?
´ð£ºMVCÊÇModel£View£ControllerµÄ¼òд¡£"Model" ´ú±íµÄÊÇÓ¦ÓõÄÒµÎñÂß¼£¨Í¨¹ýJavaBean£¬EJB× ......
ת×Ô http://www.javaeye.com/topic/309457
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
......