Bitwise Operator and Special Operator in java
Note link :- https://drive.google.com/file/d/1acKICef4F3xOPot_7gjAtgj5zLjrFl1G/view?usp=sharing
--------------------------------------
Last Video Link:-https://youtu.be/hVYRgP-MpA4
-------------------------------------
Java Playlist Link:-https://youtube.com/playlist?list=PLTC1zyZn0e-1SzenBK9ZJeNuNJWSbVC94
------------------------------------
The bitwise operator works on bits and performs bit-by-bit operations on the operands.
1) Bitwise And operator:
The bitwise AND operator takes two numbers as operands and does AND on every bit of two numbers. The result of AND is 1 only if both bits are 1.
Example int x = 12 and 5 here the value of x is 4 as the result of bitwise AND operation
12 binary is 1100
5 binary is 0101
AND 0100 is binary of 4
2) Bitwise OR operator
The bitwise or operator takes two numbers as operands and does or on every bit of two numbers. The result of OR is 1 if any of the two bits is 1
Example:
int x = 12 OR 5 here the value of x is 13 as the result of bitwise OR operation
12 binary is = 00001100
5 binary is = 00000101
----------------------------- (bitwise OR)
13 = 00001101
3) Bitwise XOR
The bitwise XOR operator takes two numbers as operands and does XOR on every bit of two numbers. The result of XOR is 1 if the bits of both the numbers are different
Example
Int x = 12 5 here the value of x is 9 as the result of bitwise XOR operation
Binary of 12 is 00001100
Binary of 5 is 00000101
Use XOR-------------------
9 = 00001001
4) Bitwise NOT : This operator performs a bitwise NOT operation on the operand.
The bitwise NOT operator takes one number and inverts all bits of it.
Changing all 0s to 1s and vice versa.
For example:
Int x= 1 // here the value of x is -2 as the result of bitwise NOT operation
bitwise NOT: 0001 = 1
5) Bitwise Left-Shift
The left shift operator takes operands and shifts the bits to the left of the first operand. The second operand decides the number of places to shift.
Example
Int x = 3 left shift 2 here the value of x is 12 as the result of bitwise left shift operator
3 is binary form is 0011, now to perform left shift by 2 places and fill the empty places with zeros
3 = 00000011
00001100 // two shift
) Bitwise Right-shift
The right shift operator takes operands and shifts the bits to the right of the first operand. The second operand decides the number of places to shift
Example
Int x = 14 right shift 2 here the value of x is 3 as the result of bitwise right shift operator
14 2
Binary of 14 is 00001110
2 shift right is 00000011 = 3
Trick to evaluate the shift operators quickly
Left shift multiple by 2
3 left shift 1 = 6 // multiple 3 by 2 one time
Right shift divide by 2
4 right shift 1 = 2 // divide 4 by 2 one time
Note : bitwise operators may not be applied to float or double values
00001100 is the binary of 12
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Bitwise Operator and Special Operator in java», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.