What will be printed as a result of the following code execution?

public class Test {
    public static void main(String[] args) {
        int i = 1;
    static void add(int i) {
        i += 2;
The value of the i variable increases by 1 each time it is transferred to the corresponding method.
A variable with the same name is used inside the add() method, but any actions performed under it do not modify the initial variable.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Java
Зарегистрируйся сейчас
или Подпишись на будущие тесты