| 1 | package Example_16; |
| 2 | |
| 3 | public class Example { |
| 4 | |
| 5 | public static int powersOf2(int n) { |
| 6 | if (n < 1) { |
| 7 | return 0; |
| 8 | } else if (n == 1) { |
| 9 | System.out.println(1); |
| 10 | return 1; |
| 11 | } else { |
| 12 | int prev = powersOf2(n / 2); |
| 13 | int curr = prev * 2; |
| 14 | System.out.println(curr); |
| 15 | return curr; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | public static void main(String[] args) { |
| 20 | powersOf2(4); |
| 21 | } |
| 22 | |
| 23 | } |
nothing calls this directly
no outgoing calls
no test coverage detected