| Author |
insertion operator
|
prashantK Singh
Greenhorn
Joined: Sep 11, 2006
Posts: 19
|
|
hi all kindly somebody elaborate me the result of the program class EBH007{ public static void main (String[] s) { byte b = 5; System.out.println(b<<1); }}
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
The left-shift operator will move all of the bits over by 1 position, so the result is going to be 00000000000000000000000000001010
|
 |
wise owen
Ranch Hand
Joined: Feb 02, 2006
Posts: 2023
|
posted

0
|
|
How do the '>>', '>>>', and '<<' operators work?
|
 |
prashantK Singh
Greenhorn
Joined: Sep 11, 2006
Posts: 19
|
|
hello it is showing the output as 10 and not 1010
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
|
The binary representation of 10 is 1010. What I showed is the bit string that is produced.
|
 |
prashantK Singh
Greenhorn
Joined: Sep 11, 2006
Posts: 19
|
|
|
thank you Keith
|
 |
 |
|
|
subject: insertion operator
|
|
|