digital-garden/notes/Собеседования/Задачи/Задача 17.md

29 lines
583 B
Markdown
Raw Normal View History

2024-06-13 21:01:37 +03:00
---
parents:
- "[[Вопросы для собеседование Java]]"
---
```java
public class Main {
public static void main(String[] args) {
System.out.println(testMethod(5, 10));
}
public static int testMethod(int a, int b) {
int result = 10;
try {
if (a == 10) {
return result + 10;
} else if (b == 20) {
return result + 20;
}
return result;
} finally {
result += 15;
System.out.println(result);
}
}
}
```
***