How to multiply number by 4 using bitwise operator in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        int n = 24;
    
        n = n << 2;

        System.out.println(n);
    }
}



/*
run:

96

*/

 



answered Jul 15, 2020 by avibootz

Related questions

1 answer 217 views
1 answer 158 views
1 answer 156 views
1 answer 148 views
1 answer 172 views
1 answer 193 views
1 answer 154 views
...