Unary Operator - how it is working in this case??

Hi,
I have got a piece of code...some one plz clearify the output of this code.
int a = 10;
a = a++; //1
a++; //2
System.out.println(a);
now the problem is that if i comment line //2 then the output is 10. If I comment the line at //1 and removing the comment at line at //2 then the output is 11.
Can some one plz help me out to know what is happening behind the scene.
Thanks
GShankar

a = a++; //1In the above expression the right hand side of the assignement is first evaluted (to 10 in your example). Then a is incremented to 11. Finally a is assigned the result of the right hand side evaluation so it becomes 10 again.
So the total effect of the expression is that nothing happens.

Similar Messages

  • I've moved my Aperture library to another computer, and masters are referencing an old path name.  How can I update these references?  Reloctating masters does not work in this case :(

    I've moved my Aperture library from one computer to another using Finder.
    I merged the library with one which was already on the computer.
    Now, the photos I imported have reference to the old path name on my old computer.
    How can I update these references as "Relocate Masters" does not work in this case?

    Just one suggestion to be able to reconnect all at once:
    Create a smart album containing the images with missing masters:
    File -> New ->  Smart Album,     and add a rule: File Status is "Missing"     (or File Status is "offline")
    Then select the images in this album and go to the File menu:
    and select:   File -> Locate referenced File
    If you are lucky, Aperture will reconnect all at once, if you point the first image version to its counterpart.

  • Itunes 11.1.5 will not sync new apps with iPhone 5 iOS 7.0.6 and gives grayed out "install" no message?  How does one work around this?

    Itunes 11.1.5 (MacBook Pro,OS 10.6.8) will not sync new apps with iPhone 5 iOS 7.0.6 and gives grayed out "install" no message?  How does one work around this?

    Just reboot your laptop... While its rebooting try to reboot your phone also by holding the home and power buttonn for 10-15 seconds...When your phone is turned off try to connect it to iTunes and it will recognize your phone in recovery mode.
    If you have the .ipsw file for iOS 7.0.6 saved in your desktop then in itunes press shift and click on Restore.
    Select the ipsw file and let it restore.
    If you dont have it downloaded then simply click on restore.
    I hope it works
    Cheers !

  • Home Sharing turns off as soon as my computer enters sleep mode.  How can I work around this issue?

    Home Sharing turns off as soon as my computer enters sleep mode.  How can I work around this issue?

    please start firefox in safemode (by pressing the shift-key while it is launching) & go to ''firefox > options > advanced > general'' & disable hardware acceleration.
    for some background on that issue you can also refer to [https://bugzilla.mozilla.org/show_bug.cgi?id=812683 bug #812683]

  • HT202919 I need to update my ARD admin from 3.6 to 3.7 but client is at 3.8 and it errors out. How do I work around this?

    I need to update my ARD admin from 3.6 to 3.7 but client is at 3.8 and it errors out. How do I work around this?

    This is a concern amoung many corporate users.  It's going to take somekind of policy change with apple.
    Enterprise support:
    Call enterprise support  (866) 752-7753  to create  a case ID number

  • I upgraded my macbookpro hard drive to 1 TB then migrated my files from time machine. I'm now locked out of the computer because the password is not the same as my usual one and one that was years old and not retreivable. How do I work around this?

    I upgraded my macbookpro hard drive to 1 TB then migrated my files from time machine. I'm now locked out of the computer because the password is not the same as my usual one and one that was years old and not retreivable. How do I work around this?

    Whether or not you are able to recover the data off the drive yourself will depend on if the drive suffered any impact damage in the crash. You can buy USB SATA or IDE adapters (Intel and almost all G5 use SATA) that will let you connect your hard drive to a computer (like a flash drive) to see if you can recover the data. If the drive has suffered physical damage if may not mount.
    If you know someone who has one of these adapters you could try using theirs, otherwise you could buy one but you take the risk of the data on the drive being non recoverable. Regardless, both are much cheaper than $1699!
    (Alternatively, if you know of someone with a Mac Pro or PowerMac G5 they may be able to install the drive in their machine and try to boot from or mount it and copy the data off.)

  • CS5 Print Booklet is not generating a booklet. How can I work around this?

    I have updated to CS5 and now when I use  "print Booklet" for my 12 page inDesign document, no pdf is produced. In CS3, the pdf appeared with no problem, ready to take to the printer, all spreads ready for saddle stitch printing on ledger paper. I can produce a pdf of the spreads as one reads it, or a pdf of each 8 1/2 x 11 page saparately, just not the booklet. I have read of people using a script to make a booklet in CS5. It seems that Adobe should fix this problem, and in the meanwhile make it clear where to get the script and how to use it.
    I'm using Snow Leopard on a Mac, Snow Leopard and CS5 both new to me at the same time. I think CS3 was better, perhaps, but I no longer have it.
    All help will be appreciated.
    judymueller

    Hi Judy,
    If you'd like to give us a try please do. Just go to www.quite.com and download a Demo copy. Here is a temporary number so you can test drive our products before you purchase.
    Quite Imposing Plus 2.9 (approx. $899.00). If, you are just doing booklets and basic Imposition check out Quite Imposing 2.9 (approx. $475.00)
    Works with Acrobat 5.0 thru 9.0 plug-ins (MAC/WIN).
    Once loaded, check out Getting started tech sheet - go to our Imposition Control Panel and click on the ? button.....then click the Getting Started button.
    Lots of good information on signature setups and Step-by-step Instructions and New features. Orhttp://www.quite.com/imposing/techsheet/
    Here are your temporary serial numbers:
    Quite Imposing
      Expires end 2/2011  Serial 6386-4776-6617-8717  Code 4263
    Quite Imposing Plus
      Expires end 2/2011  Serial 6704-8851-8612-4682  Code 6957
    If you want a workflow imposition product check out Quite Hot Imposing...however, I don't think you need that in this case.
    cheers,
    Charles
    Charles James
    Technical/Marketing Director
    Quite
    USA
    858.581.9143
    [email protected]
    [email protected]
    www.quite.com

  • How can I work around this issue when buying a new mac? And what will the difference be in speed?

    OK. In a nutshell.
    I am getting render times (converting to H.264 for web, 8000kbps, 720x1280) of about 25 minutes with my current Macbook Pro - 4GB ram. Without doing anything else with the machine.
    First question - how much can I reasonably expect this time to reduce to with:
    A. 21.5-inch: 2.5GHz
    2.5GHz Quad-Core Intel Core i5
    1920 x 1080 resolution
    4GB (two 2GB) memory
    500GB hard drive1
    AMD Radeon HD 6750M with 512MB
    - - - OR - - -
    B. 15-inch: 2.2 GHz
    2.2GHz quad-core
    Intel Core i7
    4GB 1333MHz
    500GB 5400-rpm1
    Intel HD Graphics 3000
    AMD Radeon HD 6750M with 512MB GDDR5
    Built-in battery (7 hours)2
    Am I going to buy myself much time?
    Secondly I would like to keep my existing MacBook Pro. Installed on this machine I have FCP 6. I regulary edit as I own a produciton company. I cannot upgrade to Lion as it does not support FCP 6.
    I could upgrade to FCP 7 (which would cost a fortune and still would only provide one licence) or FCP 10. The later is attractive, but looking at Apple's Specs, I meet all the specs on my MacBook bar the graphics card. I have a GL Graphics Card (GeForce 8600M GT) but for some reason this is excluded from the list of acceptable graphic cards.
    So...the possibilities are:
    A. Get a iMac. Downgrade it to Snow Leopard. Back up from my Time Machine so FCP is now on both machines. Is this even possible? Since the license will only cover one machine?
    B. Get a iMac. Keep as Lion and buy FCP 10. Upgrade MacBook to Lion, but partition the drive with Snow Leopard so I can still have FCP 6. Download FCP 10 to my MacBook and hope it works even though my graphics card is not supported (I hear it might). How do I even get FCP 10 on my MacBook? Will it tell me I cannot install it because it recognises I don't have the right graphics card?
    C. Get a MacBook Pro. Do all the above, but if it doesn't work, sell my old MacBook Pro.
    Any help on this matter would be greatly appreciated.

    The warranty will be valid within one year from the original date of purchase. this is the date that the device was purchased either from apple or an apple authorized reseller.
    you are able to purchace the applecare protection plan within one year of the original date of purchase as well, provinding there is no accidental damage to the device.
    This page pertains to your question:
    http://www.apple.com/support/products/faqs.html
    hope it helps.

  • Can someone explain how garbage collector works in this program ?

    class Chair {
    static boolean gcrun = false;
    static boolean f = false;
    static int created = 0;
    static int finalized = 0;
    int i;
    Chair() {
    i = ++created;
    if(created == 47)
    System.out.println("Created 47");
    public void finalize() {
    if(!gcrun) {
    // The first time finalize() is called:
    gcrun = true;
    System.out.println(
    "Beginning to finalize after " +
    created + " Chairs have been created");
    if(i == 47) {
    System.out.println(
    "Finalizing Chair #47, " +
    "Setting flag to stop Chair creation");
    f = true;
    finalized++;
    if(finalized >= created)
    System.out.println(
    "All " + finalized + " finalized");
    public class Garbage {
    public static void main(String[] args) {
    // As long as the flag hasn't been set,
    // make Chairs and Strings:
    while(!Chair.f) {
    new Chair();
    new String("To take up space");
    System.out.println(
    "After all Chairs have been created:\n" +
    "total created = " + Chair.created +
    ", total finalized = " + Chair.finalized);
    // Optional arguments force garbage
    // collection & finalization:
    if(args.length > 0) {
    if(args[0].equals("gc") ||
    args[0].equals("all")) {
    System.out.println("gc():");
    System.gc();
    if(args[0].equals("finalize") ||
    args[0].equals("all")) {
    System.out.println("runFinalization():");
    System.runFinalization();
    System.out.println("bye!");
    } ///:~
    This code is From Bruce Eckel's "thinking in Java"
    Here is what I understand and what I don't
    At a certain point during the execution of the while loop (in the method main), the garbage collector kicks in and will call the method finalize() -
    I am at a loss as to what happens afterwards -
    Do the chairs continue to get created (which means the variable i keeps incrementing) and the finalize method keep getting called (which means finalized keeps incrementing) till the system realizes it is really low on memory and starts reclaiming memory ie i now starts decrementing ?
    What I would like to know is the exact flow or execution of the code after the garbage collector starts kicking in ie. what happens to the variables "i" (does it increment and then decrement), "created" (does it keep incrementing ), "finalized" (does it keep incrementing) and when is the if i==47{ } statement within finalize() get executed.
    There is no part of the code where i is being decremented (so I am guessing that it is the garbage collector reclaiming object memory that must be decrementing it).
    I am really confused -unfortunately there's very little in the book that really explains the flow of execution after the garbage collector kicks in and finalize() is called.
    Any help would be greatly appreciated

    Nice example, but Bruce chose some suboptimal names, I think.
    "i" can be thought of as the "ID" of a given Chair (note that it is not static). It is neither incremented nor decremented - it's just assigned from "created". This lets us identify specific chairs (like, say, "Chair #47").
    "created" is a running total of the number of times the Chair constructor has been called.
    "finalized" is a running total of the number of Chairs that have been finalized.
    The process starts creating Chairs as fast as it can. Eventually, memory gets low, and gc() starts collecting Chairs. While that's happening, chairs are still being created in the main Thread. So "created" and "finalized" may both be incrementing at the same time.
    When gc() picks Chair#47, the finalizer code sets a flag that causes new Chairs to stop being created. This causes the program to fall out of the while() loop, and the program spits out its data and exits.
    On my machine, the program created 29,542 chairs before exiting.
    Remember - often, gc() runs only when/if the JVM decides it's running low on memory. Specifics depend on the JVM and the startup options you use - some JVMs are very, very clever about doing incremental garbage-collection these days.
    Does that make more sense?
    Grant
    (PS - it's very, very good that you posted a working code sample. But learn about the \[code\] and \[code\] tags, please - makes your sample WAY easier to read...)

  • Missing something on how NULL's work with this sql... help....

    I'm missing something here and - I'm hoping someone can help me out...
    IF I have a SQL statement:
    Select Distinct columna
    From table1
    where columnb = value1
    and columna NOT IN ('a','b','c');
    Where Value1 is on two rows.... and - columna has a NOT NULL value on one row and - null on the other row - I get a single row returned with the distinct single value from the table (excluding the NULL row).
    However - if I write it like this - I start getting a NULL and the value (two rows returned)... and - I'm not sure why (though I'm certain I should be but - it's eluding me)....
    Select Distinct columna
    From table1
    where columnb = value1
    and columna NOT IN (select code_value
    from code_table
    where code_value = columna);
    In the second query - there are no nulls in that code_table - it simply holds all the values that are to be excluded from the query.
    I'm not sure why the top one returns a single row and the bottom returns the row with the NULL and the other with the value...
    Any help is appreciated.

    Ok - removed the join on the subselect "where code_value = columna" and - it no longer returns null.

  • How to ''give'' error for this case of an EXTERNAL TABLE?

    Our external table routine works fine:
    -- We have a csv file with 2 cols.
    -- When we create the table referring the csv it works fine.
    -- Even if the csv has more the 2 cols, the ET command only takes the 2 cols and it works fine.
    -- Now, users are saying that if the csv has more than 2 cols, the ET command should give an error
    I went through the command but cannot find any clause which will do this.
    Is there any other way or workaround?
    CREATE TABLE <table_name> (
    <column_definitions>)
    ORGANIZATION EXTERNAL
    (TYPE oracle_loader
    DEFAULT DIRECTORY <oracle_directory_object_name>
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY newline
    BADFILE <file_name>
    DISCARDFILE <file_name>
    LOGFILE <file_name>
    [READSIZE <bytes>]
    [SKIP <number_of_rows>
    FIELDS TERMINATED BY '<terminator>'
    REJECT ROWS WITH ALL NULL FIELDS
    MISSING FIELD VALUES ARE NULL
    (<column_name_list>))\
    LOCATION ('<file_name>'))
    [PARALLEL]
    REJECT LIMIT <UNLIMITED | integer>;
    Is it possible to use the READSIZE?
    Edited by: Channa on Sep 23, 2010 2:28 AM

    -- Now, users are saying that if the csv has more than 2 cols, the ET command should give an error
    I went through the command but cannot find any clause which will do this.
    Is there any other way or workaround?I looked at Serverprocess' sql*loader script and did not see how that would answer your question - how to raise an error if the file has more than 2 columns. If I missed something can Serverprocess explain?
    I can't think of a direct way to do this with your external table either, but there may be indirect ways. Some brainstorming ideas of perhaps dubious usefulness follow.
    Placing a view over the external table can limit results to the first two columns but won't raise an error.
    A pipelined function can read the external table, check for data where there shouldn't be any, and raise an exception when you find data in columns where there should not be any.
    Similarly, you could ditch the external table and use utl_file to read the file, manually parsing and checking the data. LOTS more work but more control on your end. External tables are much easer to use :(
    Or, first load the external table into a work table before the "real" select. Check the work table for the offending data programatically and raise an error if data is where it should not be. You could keep the existing external table and not have to do a lot of recoding.
    Or, also load the data into an otherwise unneeded global temporary table first. Use a trigger on the load to look for the unwanted data and raise an error if offending data is there
    These ideas are boiling down to variations on validating the data before you use it.
    Good luck!

  • How to use LIKE in this CASE?

    There are multiple values that start with "Aerospace".  All of them are going to be set to the same value.  I'm trying to write a Case Statement that will replace all of them with the new value, but i can't get the LIKE to work correctly.
      This can probably be done with REPLACE, but It's bugging me that I can't get the LIKE to work.  
    I've tried a few variations, but compiler hasn't like any of them.  I'm hoping to have one line of code that will work for all of the possible choices.
    What is the best way to use a LIKE or similar thing (such as CONTAINS) to set all of the fields with "Aerospace" at the beginning?
    Sorry for the small font above.  I didn't see how to change it.
    'New Sector Focus' = CASE sectorfocus
    WHEN sectorfocus LIKE 'Aerospace%' THEN '201010 - Aerospace & Defense'
    ELSE sectorfocus
    END

    CASE expression looks good. CASE blog: 
    http://www.sqlusa.com/bestpractices/training/scripts/casefunction/
    >Sorry for the small font above.  I didn't see how to change it.
    Use the HTML icon to edit the html code.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Proxy client won't work in this case?

    I have not made my client side work for a single device yet but I want to make sure I'm spending time on the right track:
    My code will be running on the application server side, there will be hundreds of devices each has its own IP address, but runs exactly the same web services, and my code will need to talk to each of the selected ones using its IP address. I see that some generated proxy class contain the particular IP of the device where the web service is running on? If so, then it won't be possible for me to use a client proxy class to talk to all the devices.
    I'm currently trying something like this:
    URL url = new URL("http://172.21.159.52:80/cmi?wsdl");
    QName serviceName = new QName("urn:Genus", "genusService");
    Service service = Service.create(url, serviceName);
    //These are for testing purpose
    System.out.println ("List of QNames of service endpoints:");
    Iterator it = service.getPorts();
    *while (it.hasNext ()) {*
    System.out.println (" " + it.next());
    I can see the single service named 'genusPortType' in the output, however when the following code is reached:
    QName portName = new QName("urn:Genus", "genusPortType");
    Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class,Service.Mode.MESSAGE);
    I got an error 'javax.xml.ws.WebServiceException: Illegal argument combination [type=javax.xml.soap.SOAPMessage,mode=MESSAGE]'. I'm confused because I see the same usage in lots of sample codes. Is it because the 'portName' part decides that these two parameters are not fit based upon the definition of 'genusPortType'? If the operation is defined like this in the wsdl file, wht values should I use?
    *<wsdl:binding name="genusBinding" type="cmi:genusPortType">*
    *     <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />*
    *     <!-- login operation -->*
    *     <wsdl:operation name="login" >*
    *          <wsdlsoap:operation soapAction="com.controlmod.terminal.services.web.services.Login#Login" />*
    *          <wsdl:input name="loginRequest" >*
    *          <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />*
    *          </wsdl:input>*
    *          <wsdl:output name="loginResponse" >*
    *          <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />*
    *          </wsdl:output>*
    *     </wsdl:operation>*
    *.............*

    Sorry for really slow response on this - are you still here/still
    having the issue?
    Fillattr runs two migrations - one for access rules, and another for
    proxy settings. I've seen cases where one works and the other fails.
    But eventually you can get it going if you find the hangup.
    Craig Johnson
    Novell Knowledge Partner
    *** For a current patch list, tips, handy files and books on
    BorderManager, go to http://www.craigjconsulting.com ***

  • HT5312 I forgot my security QA. How can I reset and it up again? The problem is: when I log in the "Password & Security" there is no "Send reset security info email to ..." How can I do in this case? Thanks in advance for prompt help

    Hello,
    I forgot my security answer fro the security questions. I want to reset it and get new one, but therer is no sign: "Send reset info email to ...".
    How can I do?
    Thanks in advance
    tolia9960

    Didn't the link to contact the iTunes Store staff in the 'Additional Information' section of that article work for you? If you don't already have a valid rescue email address, only Apple itself can assist with recovering lost answers.
    (89599)

  • How to use counter in this case

    in my selection screen i have billing doc no-vbeln.
    in my ztable i have etimes a field.
    when i enter a bill doc no and press f8, my etimes feild in ztable sets to 1.
    my requirement is if i enter a bill doc as 97600654 for first time, etimes is 1.
    for second time if i enter that same bill doc i.e 97600654 , etimes should be 2 and if third then 3 and so on.
    if a new doc is entered then etimes is again 1.
    how to code this..plz provide some code.

    Hi Rudra,
    First You need to create a Ztable(say ZTT_VBELN_COUNT) with Three fields MANDT VBELN ETIMES.
    Now in your program add code as below;
    DATA wa_vbeln_count type line of ZTT_VBELN_COUNT.
    SELECT SINGLE * FROM ZTT_VBELN_COUNT INTO CORESSPONDING FIELDS OF wa_vbeln_count where VBELN = lv_vbeln.
    IF SY-SUBRC EQ 0.
       wa_vbeln_count-etimes = wa_vbeln_count-etimes + 1.
    ELSE
       wa_vbeln_count-vbeln = lv_vbeln.
       wa_vbeln_count-etimes = 1.
    ENDIF.
    MODIFY ZTT_VBELN_COUNT FROM wa_vbeln_count.
    Regards
    Karthik D

Maybe you are looking for

  • So I have created a pdf, put it on my website and the submit to email button doesn't work. why?

    Hey, I have created a form and everything works on it, but the send to email part. I know the mailto: function is working because when I hit it on my desktop it goes through the steps to send the email. However when I upload it online the button does

  • Flash to Photoshop - colour help

    Hello, A friend and I have designed an image in Flash that we'd like to print at A1 size. As Flash won't export to this height and width, we're pulling together the different bits of the Flash image as .ai files inside Photoshop Elements 7. The only

  • 40 minutes into listening, itunes deletes my current podcast with no way to recover it.

    3 times now I've been listening to a free podcast I am subscribed to and roughly 3/4 of the way through the podcast it just disappears.  The sound abruptly stops and the current podcast I'm listening to is gone.  Deleted.  No idea how or why.  This i

  • Background effect like "Alert.show"

    Hi, I have a panel component im my application, and I need to make the rest of screen out of focus (like Alert.show do). I can´t make this panel in a popup or another windows. It must remais in the form. There is a way to do this?

  • Nokia N97 Mini Outlook meeting problems

    Hello, On my old HTC windowsphone  when i got invite to a meeting in outlook i could see on my phone what ppl are also invited / are joining the meeting. For some reason i cant find this on my new N97 Mini. Is this not supported by this phone or is t