Bitwise and BitShift Operators in Java - AND, OR, XOR, Signed Left and Right shift Operator Examples
Bitwise and Bit Shift operators in Java are powerful set of operators which allows you to manipulate bits on integral types like int, long, short, bytes and boolean data types in Java. Bitwise and Bit shift operator are among the fastest operator in Java but still many Java programmers doesn't familiar with bitwise and bitshift operations, especially those who doesn't come from C programming backgrounds. If you have already learned C or C++ before starting with Java then understanding bitwise and bitshift operators are quite easy in Java, because its similar to bitwise operation in C. Some of the tricky programming interview questionse.g. checking if a number is power of two or swapping two numbers without temporary variable or, can be easily solved using bitwise operators. This Java programming tutorial is quick recap of different bitwise operator available in Java and how to use them. This tutorial also discusses bit shift operator, both signed and unsigned with example.
Comments
Post a Comment
-Berkomentarlah yang baik dan rapi.
-Menggunakan link aktif akan dihapus.