Вопрос по java – Побочный эффект - что это?

17

Error: User Rate Limit Exceeded

If you're calling an EL function that doesn't return anything, then you're calling it just for its side effects.

Ваш Ответ

5   ответов
40

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
3

Error: User Rate Limit Exceeded

public class SideEffectClass{

    private int state = 0;


    public doSomething(int arg0){
        state += arg0;
    }
}

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
0

Error: User Rate Limit Exceeded

1

Error: User Rate Limit Exceeded

public class SideEffectClass{

    private int state = 0;

    public doSomething(...){//Does not matter
        state ++;
    }
}
12

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Похожие вопросы