File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ public class Buzz {
2+
3+ public static void baffle (String blimp ) {
4+ System .out .println (blimp );
5+ zippo ("ping" , -5 );
6+ }
7+
8+ public static void zippo (String quince , int flag ) {
9+ if (flag < 0 ) {
10+ System .out .println (quince + " zoop" );
11+ } else {
12+ System .out .println ("ik" );
13+ baffle (quince );
14+ System .out .println ("boo-wa-ha-ha" );
15+ }
16+ }
17+
18+ public static void main (String [] args ) {
19+ zippo ("rattle" , 13 );
20+ }
21+
22+ }
Original file line number Diff line number Diff line change 1+ public class Recursive {
2+
3+ public static void main (String [] args ) {
4+ System .out .println (prod (1 , 4 ));
5+ }
6+
7+ public static int prod (int m , int n ) {
8+ if (m == n ) {
9+ return n ;
10+ } else {
11+ int recurse = prod (m , n -1 );
12+ int result = n * recurse ;
13+ return result ;
14+ }
15+ }
16+
17+ }
You can’t perform that action at this time.
0 commit comments