javaµÝ¹é·ÖÎö
µÝ¹éËã·¨Éè¼ÆµÄ»ù±¾Ë¼ÏëÊÇ£º¶ÔÓÚÒ»¸ö¸´ÔÓµÄÎÊÌ⣬°ÑÔÎÊÌâ·Ö½âΪÈô¸É¸öÏà¶Ô¼òµ¥ÀàͬµÄ×ÓÎÊÌ⣬¼ÌÐøÏÂÈ¥Ö±µ½×ÓÎÊÌâ¼òµ¥µ½Äܹ»Ö±½ÓÇó½â£¬Ò²¾ÍÊÇ˵µ½Á˵ÝÍÆµÄ³ö¿Ú£¬ÕâÑùÔÎÊÌâ¾ÍÓеÝÍÆµÃ½â¡£
¹Ø¼üҪץסµÄÊÇ£º
£¨1£©µÝ¹é³ö¿Ú
£¨2£©µØÍÆÖð²½Ïò³ö¿Ú±Æ½ü
Àý×Ó:
example£º Çó5µÄ½×³Ë¡£¡£
ÈçÏ£º
Java´úÂë
public class Test {
static int multiply(int n){
if(n==1||n==0)
return n;
else
return n*multiply(n-1);
}
public static void main(String[] args){
System.out.println(multiply(10));
}
}
ÉÏÃæµÄmultiplyÊÇÒ»¸ö½×³ËµÄÀý×Ó¡£ÆäʵµÝ¹éµÝ¹é£¬´Ó×ÖÃæÉϽâÊ;ÍÊÇÔÚ·½·¨±¾Éíµ÷ÓÃ×Ô¼ºµÄ·½·¨£¬»òÕß¼ä½Óµ÷Ó㻿´ÉÏÃæµÄ³ÌÐò£¬ÄÃmultiply(5)À´Ëµ£º
n=5;Ö´ÐÐ 5*multiply(4);
--------------------
Õâʱºò¿´multiply(4)
n=4 Ö´ÐÐ 4*multiply(3);
-------------------
¿´multiply(3)
n=3,Ö´ÐÐ 3*multiply(2);
---------------
mulitply(2);
n=2 Ö´ÐÐ 2*mulitply(1);
Õâʱºò£¬return 1;ÍùÉÏ·µ»Ø
2*1ÏòÉÏ·µ»Ø
3*(2*1)ÏòÉÏ·µ»Ø
4*£¨3*£¨2*1£©£© ÏòÉÏ·µ»Ø
5*£¨4*£¨3*£¨2*1£©£© £© = 120
ËùÒÔ³ÌÐòÊä³ö120;
Õâʼòµ¥µÄµÝ¹éµÄÀý×Ó£»ËùÒÔ¿ÉÒÔ¿´³öÀ´µÝ¹éµÄ¹Ø¼ü
Ïà¹ØÎĵµ£º
61.Îļþ¼ÐÒÆ¶¯µ½ÕûºÏ²Ù×÷
/*
import java.io.*;
import java.util.*;
import javax.swing.*;
*/
JFileChooser Jfc = new JFileChooser("ÇëÑ¡ÔñԴ·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°
·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
} ......
Àࣺ
·ÃÎÊÐÞÊηû
ÐÞÊηû
class
ÀàÃû³Æ
extends
¸¸ÀàÃû³Æ
implement
½Ó¿ÚÃû³Æ
£¨·ÃÎÊÐÞÊηûÓëÐÞÊηûµÄλÖÿÉÒÔ»¥»»£©
·ÃÎÊÐÞÊηû
Ãû³Æ
˵Ã÷
±¸×¢
public
¿ÉÒÔ±»ËùÓÐÀà·ÃÎÊ£¨Ê¹Óã©
publicÀà±ØÐ붨ÒåÔÚºÍÀàÃûÏàͬµÄͬÃûÎļþÖÐ
package
¿ÉÒÔ±»Í¬Ò»¸ö°üÖеÄÀà·ÃÎÊ£¨Ê¹Óã©
ĬÈϵķÃÎ ......
¡¾ÈËÎïС´«¡¿
James Gosling £¨1955.5.19-£©¼ÓÄôó³öÉúµÄ³ÌÐòÔ±£¬ÃÀ¹ú¹¤³ÌԺԺʿ¡£ÒÔ“Java ¼¼ÊõÖ®¸¸”¶øÎÅÃûÓÚÊÀ¡£ËûÊÇJava ¼¼ÊõµÄ´´Ê¼ÈË£¬Ç×ÊÖÉè¼ÆÁËJavaÓïÑÔ£¬²¢¿ª·¢ÁËJava±àÒëÆ÷ºÍJavaÐéÄâ»ú£¬Ê¹Java³ÉΪÁËÊÀ½çÉÏ×îÁ÷ÐеĿª·¢ÓïÑÔ¡£
James GoslingÏÈÉúÓÚ1977Äê»ñµÃ¼ÓÄô󿨶û¼ÓÀï´óѧ¼ÆËã»ú¿ÆÑ§Ñ§Ê¿Ñ§ ......
21ÌìѧͨJava6 ÏÂÔØµØÖ· http://d.download.csdn.net/down/2031000/bolike£¨Ö»ÓÐÔ´´úÂ룩
<<21ÌìѧͨJava 2(µÚ¶þ°æ)>>(ÖÐÓ¢ÎİæPDF)+¸½ÊéÔ´Âë ÏÂÔØµØÖ· http://www.zzx8.com/html/c16246.html£¨ËƺõÖÐÓ¢ÎĵIJ»¶ÔÓ¦£¬¿´ÖÐÎÄ»¹ÊÇ¿´Ó¢Îĵģ¿£© ......