Skip to content

Commit d291580

Browse files
committed
feat: Add Bitwise1 class demonstrating bitwise AND operation
Add a program that: - Initializes two integers using binary literals - Performs a bitwise AND (`&`) operation - Prints the result of the bitwise computation - Demonstrates basic use of bitwise operators in Java.
1 parent 030b995 commit d291580

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
public class Bitwise1
2-
{
3-
public static void main(String[] args)
4-
{
1+
public class Bitwise1 {
2+
public static void main(String[] args) {
53
int x = 0b1010; //10;
6-
74
int y= 0b0110; //6;
85

96
int z;
107

11-
z = x & y;
12-
13-
//And Operation
8+
z = x & y; //And Operation
149

1510
System.out.println(z);
1611
}
17-
}
12+
}

0 commit comments

Comments
 (0)