Commit 1b22595
committed
feat: Add Bitwise6 class demonstrating signed right shift on negative number
Add a program that:
- Initializes a negative integer using a binary literal
- Applies a signed right shift (`>>`) by 1 bit
- Outputs the result to show how sign extension works in Java
- Prepares for unsigned right shift (`>>>`) with commented code for comparison.1 parent d4f30ca commit 1b22595
1 file changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
0 commit comments