Check out example codes for "add two numbers bitwise". It will help you in understanding the concepts better.

Code Example 1

public class Bitwise_Addition{
    int add(int a, int b){
        int c;
    while(b!=0){
        c=a&b;
        a=a^b;
        b=c<<1;
        }
    return a;
    }
}

Learn ReactJs, React Native from akashmittal.com