Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » Homework HelpRSS Feeds

Program to show the use of operator (>>) Shift Right, propagating the sign bit from the left

Posted By: Haru Tanaka     Category: Java     Views: 1535

A Java Program to show the use of operator (>>) Shift Right, propagating the sign bit from the left.

Code for Program to show the use of operator (>>) Shift Right, propagating the sign bit from the left in Java

publicclass JAVA_012
 {

    publicstaticvoid main(String[] args)
    {
       int a=26317;  // 0110011011001101int b=(a>>3); // 0001110011011001

       System.out.println("a = 0110011011001101 = " + a);
       System.out.println("b = a>>3 = 0000110011011001 = " + b);
    }
 }
  
Share: 



Haru Tanaka
Haru Tanaka author of Program to show the use of operator (>>) Shift Right, propagating the sign bit from the left is from Tokyo, Japan.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!