Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7907215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:19:35+00:00 2026-06-03T11:19:35+00:00

I have this demo program which shows the concept of shift operator in java.But

  • 0

I have this demo program which shows the concept of shift operator in java.But i’m not clear how this program generates this answer.So please suggest me how to do this.

public class Operator {
    public static void main(String[] args) {
        int s = -10;
        s = s >>2;
        System.out.println("value of i=" + s);
    }

}

Output:

value of i=-3

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:19:39+00:00Added an answer on June 3, 2026 at 11:19 am

    111101102 >> 2 == 111111012 == -310

    That’s a sign-extended shift-right operation — as it shifts right, it doesn’t insert zeros at left, but copies the value of the highest bit. The rest of the explanation is about two’s complement representation of signed integers.

    In general, right-shifting a negative integer by n positions will have the effect of dividing by 2n and subtracting 1 from that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://demo.thethemefoundry.com/traction/#post-183 Which wordpress plugin is this, to have post image on the left side
see this demo from jquery ui you have to hold down the Ctrl key
Please have a look at this demo page that I cooked up a while
So I have this page that has some basic custom tabs: http://demo.unlockedmanagement.com/users/view/2 * NOTE
I am trying to implement this demo on my local machine. http://bit.ly/4g4o1r I have
Currently I have a stacked bar chart like this ( jsfiddle demo ) I
Recently I have gone through with one simple threading program, which leads me some
I have a QTableWidget that I populate like this: // Clear the table this->topPatchesTableWidget->setRowCount(0);
I tried to do this in Hudson but: I have a script in Perl
I have created a sample/demo/test program in Android that runs quite nicely, if you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.