Why does negation of Integer.MIN_VALUE display the same value ?

Hi Guys,
This is my code :
package declarations;
public class dec32 {
     public static void main(String[] args) {
          int a = Integer.MIN_VALUE;
          int b = -a;
          System.out.println( a+ " "+b);
O/P : -2147483648 -2147483648Now,my question is why does b which is actually negation of the value of a,again print -2147483648 ?
Thank you for your consideration.

Force1 wrote:
Hi Guys,
This is my code :
package declarations;
public class dec32 {
     public static void main(String[] args) {
          int a = Integer.MIN_VALUE;
          int b = -a;
          System.out.println( a+ " "+b);
O/P : -2147483648 -2147483648Now,my question is why does b which is actually negation of the value of a,again print -2147483648 ?An Integer has a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647 (inclusive). Since negative -2,147,483,648 equals 2,147,483,648 which is one value over the maximum, it ticks over to -2,147,483,648 again.
Thank you for your consideration.Your welcome.
Mel

Similar Messages

  • Why does my iPhone 3G/iPod repeat the same song over?  I can't get any playlists or albums to play...

    Why does my iPhone 3G/iPod just play the same song over and over?  I cannot figure out how to get it to shuffle or play through an album or playlist...  It just started doing this randomly and it's very frustrating!

    You have probably Repeat turned on.  See the top of p. 77 of the User Guide.

  • Why does my macbook pro keep repairing the same disc permissions

    I am trying to figure out why my early 2008 macbook pro is lagging. I tried to repair disc permissions but it always repairs the same ones. The other thought I had was that the video card may be on its way out, but not sure how to check that.

    Some of the messages that Disk Utility provides when repairing disk permissions are informational only, and not of consequence. See this Apple note on messages you can ignore: http://support.apple.com/kb/TS1448
    On your video card, run the Apple hardware test using the extended test, which will check out the video hardware.

  • Why does a song not return to the same place when I close it?

    Recently, for some reason, when I have a song open and press 'my songs'  (which effectively closes the song) the song doesn't return to its usual location on the screen/folder. Instead it cues to the top left hand corner, and likewise with every other song, the same thing happens.
    It's only just started doing this which makes remembering what is where even more difficult.
    Any help much appreciated.

    You are welcome, Nick. Don't worry about the "é" - it will depend on your keyboard, if it is easy. On my keyboard I type first the accent ´ and then the e, and all is done

  • Why does iTunes play consecutive songs by the same artist so often?

    Is there a way to stop or greatly reduce the issue in iTunes of playing consecutive songs by the same artist when playing in "shuffle" mode?  There was a slide tool in preferences that allowed you to set that to "less likely" or "more likely" but that appears to be gone from iTunes now, or at least I can't find it.  Not that it matters much, the problem was WORSE when they added that "tool" anyway.  It was less likely before they added whatever that algorithm was.  Now this happens constantly that my iPod plays 2 or 3 consecutive songs by the same artist when I am playing it in shuffle mode.  I have over 3500 songs on my iPod but it will usually play only a small percentage of those before starting to repeat also.  It seems to "stick" in a small area of the alphabet when in shuffle mode.  Meaning, it will play artists whose names begin with say L through R and ONLY those artists, then repeat a bunch of them after playing only 20-30 songs.  Everything else seems to be working fine on my iPod but this.  I suspect it's the programming in iTunes but of course, I have no way to prove that and Apple being the quasi Communist gov't type that they are, I can get no answers from them on this or most questions I have.  Maybe somebody here has encountered one of these issues and can offer some resolution?

    I wish Apple would just remove the feature that supposedly addresses this issue.  It worked better when there was no setting for this.  I'm just tired of being pencil whipped by Big Brother.

  • Why does EO always try to import the same three files?

    Whenever I open Elements Organizer 12.1 it is attempting to import files. It always finds the same three files and then reports them already in the catalog. If I import files from my camera or card reader or folder, in addition to the files on the selected device it attempts to import the same three files that are already in the catalog. I have seen this message hundreds of times. How do I make it stop attempting to import these three files?
    I have tried deleting the three files from the catalog. The first time I opened EO it found the three files and imported them. The next time I opened EO it attempted to import the same three files and reported them already in the catalog. Arrgh...
    Steve

    Yeah depends on the source but generally MPG hasn't ever been supported in Final Cut Pro- as Tom says you want to convert it to ProRes elsewhere before bringing into FCP X.

  • Why does my iphone 4s not display the correct battery percentage? it can get really annoying if it turns off unexpectedly and after that another problem occurs with the phone turning off and on repeadtly

    My iphone 4s recently started shutting off and on unexpectedly when updating a whole load of snapchat story's on my feed. However i also have a problem with the battery percentage, i've tried everything with it experimenting all most everything. i even changed my battery twice and i still don't know what to do
    someone please help me

    Hi 3Kadzo,
    Welcome to the Apple Support Communities!
    I understand you are having some concerns about the battery usage and percentage displayed on your iPhone 4s. I would suggest the troubleshooting steps in the following article to help isolate and resolve these issues.
    iPhone and iPod touch: Charging the battery
    http://support.apple.com/kb/HT1476
    I hope this helps,   
    -Joe

  • Why does my new macbook pro display the message "startup disk is full" when i have less than 50 gb used on a 500 gb hard drive?

    This is really a problem since i need to save stuff for school work and i can't currently do that.

    It happens anytime I log in, try to save something, or open a new application that may require me to save something. Any advice would be helpful

  • Why does my iPod touch keep repeating the same song?

    Since I loaded the software update 4.1 my music keeps replaying one song unless I choose to shuffle. What have I done?

    Hello jennysipod,
    And welcome to Apple Discussions!
    Make sure you don't have your iPod set to repeat one song. While one song is playing, tap the artwork to bring up additional controls. You'll see a icon below the scrubber on right side that probably has a 1 on it. Tap it to change the setting to something else such as off.
    B-rock

  • Why does this code always gotoAndStop at the same frame?

    The symbol "alldoor" contains the following six frames in sequential order: "door1","red_door1","door2","red_door2","door3" and "red_door3".
    var doors:Array =["door1", "door2", "door3"];
    var doorSelector:String = doors[newDoors(0, doors.length - 1)]
    function newDoors (min:Number, max:Number):Number
    var  doorColors:Number = Math.round(Math.random() * (min - max) + max);
    return doorColors;
    alldoor.gotoAndStop(doorSelector);
    alldoor.addEventListener(MouseEvent.CLICK,changeColors );
    function changeColors(e:MouseEvent)
        if (e.currentTarget.currentLabel == doorSelector)
            e.currentTarget.gotoAndStop(currentFrame + 1);
         I am attempting to get this code select one of the frames starting with the string "door" at start up. Then, the door should move to the frame
    directly following it on the timeline when clicked. However, as the code is written, the frame always jumps to the second frame in the symbol,regardless of what the current label is. What should I change?

    either:
    1.  those frames aren't loaded when that code executes or
    2.  you don't have those labels on the timeline that contains that code or
    3.  there is other code executing after your goto changing your frame
    use the trace() function to debug and find which is your problem.

  • Why does my nano suddenly not display audiobooks option?

    Why does my nano suddenly not display the audiobooks option?

    There are options on the iPod's Settings screen to show or not show items in the various menus. 
    For example, on my 5th gen nano, Audiobooks in on the Music menu.  In Settings - General - Music Menu, I can select to show Audiobooks or not, on the Music menu.

  • TS1702 why does my iphone 5s not display apps to my jvc car stereo, when the same apps work with my 4s?

    why does my iphone 5s not displaying apps on my jvc car stereo.  these apps worked with my iphone 4s?

    Blackberries were designed at a time when cellular data was very expensive. They don't do nearly as much as an iPhone, in part, to conserve data use. All modern smartphones will use more data than a Blackberry unless you do almost nothing.
    You do not need to quite apps. Almost no apps run in the background.
    Here are Apple's tips on iPhone battery use:
    http://www.apple.com/batteries/iphone.html
    If you are really only getting an hour of battery usage and not just engaging in hyperbole (), you should make an appointment with the Genius Bar at your local Apple Store.

  • Why does final cut x not recognize the sharp PN- K321 monitor ( European version ) as output video monitor and premiere it? Working with two cinema display and PN- K321 and I can not preview the output video at 4K for DisplayPort, whereas with premie

    Why does final cut x not recognize the sharp PN- K321 monitor ( European version ) as output video monitor, and premiere yes?
    Working with two cinema display and PN- K321 and I can not preview the output video at 4K by DisplayPort, whereas with premiere and after effects I have no problems

    Look, you can build an HD DVD with an SD movie, just as you can build an SD DVD with an HD movie. This is not a bug, it is most likely user error. Apple will not be addressing it.
    Just start over, and ensure you are building an SD DVD by bringing up the inspector for the disc (click on the background in the Graphical tab).
    Make sure SD DVD is selected:
    (If you do the same thing on your ill fated project, you'll see that HD DVD is selected)
    Build your DVD and you'll be fine.
    Patrick
    P.S. You will need to google HD DVD and Blu-Ray if you want to understand the difference between the formats. The reason that DVDSP included HD DVD was that its format was similar to SD DVD's. Blu-Ray is something else entirely.

  • Why does my macbook pro retina display shutdown while entering the administer account

    why does my macbook pro retina display shutdown while entering the administer account

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, or by corruption of certain system caches. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and  Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • I have an airport extreme 2013.  Why does my airport utility sometimes display IP addresses and other times the names of the devices?  I want it to always display the device names.

    I have an airport extreme 2013. Why does my airport utility sometimes display IP addresses and other times the names of the devices? I want it to always display the device names.

    The utility has had less and less useful information .. it might be time to simply find a different utility.
    Fing network scanner. iphone and ipad.
    https://itunes.apple.com/au/app/fing-network-scanner/id430921107?mt=8
    This is very popular.. I do not know of what works well on Mac OS because i have installed 5.6 utility which of course has far more info than the later toy version. Plus using an Asus router which has excellent listing of all the clients.
    Sometimes beating yourself up to make apple routers do what you want is easier solved with lateral thinking.

Maybe you are looking for

  • How to remove credit card details in itune

    how to remove credit card details from my account when i puchased app from the istore?

  • Dropped sales order report from SAP

    Team, There is a specific requirement regarding sales order..to analyze the  dropped /undelivered order for a period. Currently we are entering only those sales orders in the system which can be shipped/delivered to customer..all those SOs which can'

  • Multiple planned orders for a requirement

    Hi,        We have PPDS MRP with NEW shelflife w/ lot size profle run for product and produces multiple planned orders for the the requirements. I have a requirement of 4,750 and 14,976 in the system and available stock 86,966. The system creates two

  • Declaring Field Symbols in a work area

    Hi all! I'm triying to learn the use of FieldSymbols, and I wrote in  my code this: REPORT  zpractica01. Types TYPES: BEGIN OF ty_tabla,         name(25)    TYPE c,         address(60) TYPE c,         monto(3)     TYPE p decimals 2,         END OF ty

  • Mismatch between Print preview and printout

    Respected Guru's Output device was defined during Febuary, and printout was taken without trouble untill today. Suddenly the print preview and printout does not match, title "INVOICE" printed at the top of the sheet is missing, whereas appears in the