CJCoding With Joseph
15per day
← Back to Question List
Java Code Walkthrough #24

Nested Method Calls

mediumFunctions

📄 Code

Read carefully — what does this print?
1public class Main {
2 static int add(int a, int b) {
3 return a + b;
4 }
5 
6 static int multiply(int a, int b) {
7 return a * b;
8 }
9 
10 public static void main(String[] args) {
11 int result = add(multiply(2, 3), multiply(4, 5));
12 System.out.println(result);
13 }
14}

🎯 Your Answer