I think the answer is simple, but still I do not understand it.
byte a=5; int b=10; int c=a>>2+b>>2; System.out.print(c);
Since a>>2- 1, and b>>2- 2, I expect the output to be 3, but equal 0. What reason?
a>>2
1
b>>2
2
3
0
This is due to the priority of the operator .
What you do is the same as
int c=(a>>(2+b))>>2;
Do you want to:
int c=(a>>2)+(b>>2);
Source: https://habr.com/ru/post/1548639/More articles:ReactJS - ReactMount: The root element has been removed from the original container. New container - javascriptdifferent fabric parameters in different hosts - pythonWhy can't I assign a variable inside isset? - php - phpKivy: how to get widget by id (without kv) - pythonTroublesome System.TypeLoadException - c #Combining the latter with the previous value in the observed stream - c #implicit intent for contact list - androidAngularJS Выберите другой вариант и получите значение из текстового поля - angularjsВычислить текущее время со следующего минимума, затем NSTimer не должен работать - ioshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1548644/adding-source-files-to-gradle-project&usg=ALkJrhjxsWcolR1D8nTAg9ppATvqsvWZNQAll Articles