1. Method overloading
Different types of return values are obtained by calling different functions:
Overloads of the method:
* Method name is the same
* Depending on the parameter type, the parameter type Order, the number of parameters to determine the criteria to distinguish calls
* Return value is not used as a judging condition
2. Yang Hui Triangle code:
The output of the Yang Hui Triangle is completed by a recursive relationship.
3. The judgment of palindrome string:
Code:
By using the recursive relationship, the process of judging whether a palindrome is done by invoking the function of itself.
4. Generate random numbers of code:
for (Long i = 1; i <=; i++) {//1000 random numbers
Value = 1 + (int) (Math.random () * 100); The range of random numbers is 1~100
if (i&50==0) output+= "\ n"; 50 numbers per line
5. Calculate the number of combinations:
(1) Calculation using the formula of combination number:
Use the combination number formula to calculate with n!
(2) Using recursive relations to calculate:
6. Hanoi Game:
(1) Code:
I
(2) Code:
Applets for Java recursive and recursive applications