Java ³ÌÐò±àÂë¹æ·¶
ËùÓеijÌÐò¿ª·¢Êֲᶼ°üº¬Á˸÷ÖÖ¹æÔò¡£Ò»Ð©Ï°¹ß×ÔÓɳÌÐòÈËÔ±¿ÉÄܶÔÕâЩ¹æÔòºÜ²»ÊÊÓ¦£¬µ«ÊÇÔÚ¶à¸ö¿ª·¢ÈËÔ±¹²Í¬Ð´×÷µÄÇé¿öÏ£¬ÕâЩ¹æÔòÊDZØÐèµÄ¡£Õâ²»½ö½ö
ÊÇΪÁË¿ª·¢Ð§ÂÊÀ´¿¼ÂÇ£¬¶øÇÒÒ²ÊÇΪÁ˺óÆÚά»¤¿¼ÂÇ¡£
ÃüÃû¹æ·¶
¶¨ÒåÕâ¸ö¹æ·¶µÄÄ¿µÄÊÇÈÃÏîÄ¿ÖÐËùÓеÄÎĵµ¶¼¿´ÆðÀ´ÏñÒ»¸öÈËдµÄ£¬Ôö¼Ó¿É¶ÁÐÔ£¬¼õÉÙÏîÄ¿×éÖÐÒòΪ»»È˶ø´øÀ´µÄËðʧ¡££¨ÕâЩ¹æ·¶²¢²»ÊÇÒ»¶¨Òª¾ø¶Ô×ñ
ÊØ£¬µ«ÊÇÒ»¶¨ÒªÈóÌÐòÓÐÁ¼ºÃµÄ¿É¶ÁÐÔ£©
Package µÄÃüÃû
Package µÄÃû×ÖÓ¦¸Ã¶¼ÊÇÓÉÒ»¸öСдµ¥´Ê×é³É¡£
Class µÄÃüÃû
Class µÄÃû×Ö±ØÐëÓÉ´óд×Öĸ¿ªÍ·¶øÆäËû×Öĸ¶¼Ð¡Ð´µÄµ¥´Ê×é³É
Class ±äÁ¿µÄÃüÃû
±äÁ¿µÄÃû×Ö±ØÐëÓÃÒ»¸öСд×Öĸ¿ªÍ·¡£ºóÃæµÄµ¥´ÊÓôóд×Öĸ¿ªÍ·¡£
Static Final ±äÁ¿µÄÃüÃû
Static Final ±äÁ¿µÄÃû×ÖÓ¦¸Ã¶¼´óд£¬²¢ÇÒÖ¸³öÍêÕûº¬Òå¡£
²ÎÊýµÄÃüÃû
²ÎÊýµÄÃû×Ö±ØÐëºÍ±äÁ¿µÄÃüÃû¹æ·¶Ò»Ö¡£
Êý×éµÄÃüÃû
Êý×éÓ¦¸Ã×ÜÊÇÓÃÏÂÃæµÄ·½Ê½À´ÃüÃû£º
byte[] buffer;
¶ø²»ÊÇ£º
byte buffer[];
·½·¨µÄ²ÎÊý
ʹÓÃÓÐÒâÒåµÄ²ÎÊýÃüÃû£¬Èç¹û¿ÉÄܵĻ°£¬Ê¹ÓúÍÒª¸³ÖµµÄ×Ö¶ÎÒ»ÑùµÄÃû×Ö£º
SetCounter(int size){
this.size = size;
}
Java ÎļþÑùʽ
ËùÓÐµÄ Java(*.java) Îļþ¶¼±ØÐë×ñÊØÈçϵÄÑùʽ¹æÔò
°æȨÐÅÏ¢
°æȨÐÅÏ¢±ØÐëÔÚ java ÎļþµÄ¿ªÍ·£¬±ÈÈ磺
/**
* Copyright ? 2000 Shanghai XXX Co. Ltd.
* All right reserved.
*/
ÆäËû²»ÐèÒª³öÏÖÔÚ javadoc µÄÐÅÏ¢Ò²¿ÉÒÔ°üº¬ÔÚÕâÀï¡£
Package/Imports
package ÐÐÒªÔÚ import ÐÐ֮ǰ£¬import Öбê×¼µÄ°üÃûÒªÔÚ±¾µØµÄ°üÃû֮ǰ£¬¶øÇÒ°´ÕÕ×Öĸ˳ÐòÅÅÁС£Èç¹û import ÐÐ
Öаüº¬ÁËͬһ¸ö°üÖеIJ»Í¬×ÓĿ¼£¬ÔòÓ¦¸ÃÓà * À´´¦Àí¡£
package hotlava.net.stats;
import java.io.*;
import java.util.Observable;
import hotlava.util.Application;
ÕâÀï java.io.* ʹÓÃÀ´´úÌæInputStream and OutputStream µÄ¡£
Class
½Ó
Ïà¹ØÎĵµ£º
ÔËÐÐÓ¦ÓóÌÐòÓëÔËÐÐweb³ÌÐòÔÀíÊÇÒ»Öµģ¬Ö»²»¹ýwebÓ¦ÓóÌÐòÒѾÔÚÆô¶¯Ê±½«³ÌÐòÔËÓõÄjar°üÉèÖõ½»·¾³±äÁ¿ÀӦÓóÌÐò¿ÉÒÔ×Ô¼ºÐ´¸öÅú´¦ÀíÀ´ÉèÖû·¾³±äÁ¿£º
java -classpath ./lib/application.jar;./lib/hibernate3.jar -Xms608m -Xmx608m com.zyj.application.StartUp
pause/exit
ÆäÖÐapplication.jarΪӦÓóÌÐòµÄjar° ......
public List<Integer> findSame(int array1[], int array2[]) {
// Öظ´ÔªËؽá¹û¼¯ºÏ
List<Integer> result = new ArrayList<Integer>();
// ......
Java: class , objects
1 Inheritance(¼Ì³Ð)µÄ¹Ø¼ü×Öextends
class MountainBike extends Bicycle {
}
µ«ÊDz»ÄܶàÖؼ̳С£²»¹ý¿ÉÒÔͨ¹ýimplements¶à¸öinterfaceÀ´ÊµÏÖÀàËƵĶ«Î÷
2 interface
interface Bicycle {
void changeCadence(int newValue); // wheel rev ......
²åÈëÅÅÐòµÄ¹¤×÷ÔÀíÊÇͨ¹ý¹¹½¨ÓÐÐòÐòÁУ¬¶ÔÓÚδÅÅÐòÊý¾Ý£¬ÔÚÒÑÅÅÐòÐòÁÐÖдӺóÏòǰɨÃ裬ÕÒµ½ÏàӦλÖò¢²åÈë¡£Æä¾ßÌå²½Öè²Î¼û´úÂë¼°×¢ÊÍ¡£
view plaincopy to clipboardprint?
/**
* ²åÈëÅÅÐò<br/>
* <ul>
* <li>´ÓµÚÒ»¸öÔªËØ¿ªÊ¼£¬¸ÃÔªËØ¿ÉÒÔÈÏΪÒѾ±»ÅÅÐò ......
Tiger ÖеÄÒ»¸öÖØÒªÐÂÌØÐÔÊÇö¾Ù¹¹Ô죬ËüÊÇÒ»ÖÖеÄÀàÐÍ£¬ÔÊÐíÓó£Á¿À´±íʾÌض¨µÄÊý¾Ý Ƭ¶Ï£¬¶øÇÒÈ«²¿¶¼ÒÔÀàÐÍ°²È«µÄÐÎʽÀ´±íʾ¡£Tiger ר¼Ò¡¢developerWorks µÄ¶à²ú×÷Õß Brett McLaughlin½«½âÊÍö¾ÙµÄ¶¨Ò壬½éÉÜÈçºÎÔÚÓ¦ÓóÌÐòÖÐÔËÓÃö¾Ù£¬ÒÔ¼°ËüΪʲôÄܹ»ÈÃÄúÅ×ÆúËùÓоɵÄ
public static final ´úÂë¡£
¡¡ ÄúÒѾ ......