0% found this document useful (0 votes)
13 views

Shift Operator Program in Java

Uploaded by

chiraghz
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Shift Operator Program in Java

Uploaded by

chiraghz
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

hackingzo ne s.

co m

http://hackingzo nes.co m/?p=6287

Shift Operator Program in Java

package hz_lib; public class shif ting { public static void main(String k[]) { int b=16; System.out.println(Right shif t +(b>>2)); //Right shif ting operator by 2 bits System.out.println(Lef t shif t +(b<<2)); //lef t shif ting operator by 2 bits System.out.println(Right shif t with zero f ill +(b>>>2)); //Right shif ting operator by 2 bits with zero f ills } } Output : Right shif t 4 Lef t shif t 64 Right shif t with zero f ill 4

Relat ed Post

SHA1 Hash generating program in java MD5 Hash generating program in java Java Program to Find Network Interf ace Java Program to f ind Your IP Address and LoopBack Address Enter your email address:

Delivered by FeedBurner

Post Footer automatically generated by Add Post Footer Plugin f or wordpress.

You might also like