Any difference between:  if ( a 16) or if ( a =15 ) ?

i need a test to see if an int is equal or less then 15
first code was
if ( myint <= 15 )
    doSomething
    }This is the most natural way because the test corresponds with the demands.
Then i started to ponder
I following better ?
if ( myint < 16 )
    doSomething
    }I guess not because any smart compiler should know best way for both and make similar code.
So my question: IS there any difference ?

public class LTTest {
  public static void testOne(int a) { if (a <= 15) System.exit(15); }
  public static void testTwo(int a) { if (a <  16) System.exit(16); }
$ javap -c LTTest
Compiled from "LTTest.java"
public class LTTest extends java.lang.Object{
public LTTest();
  Code:
   0:   aload_0
   1:   invokespecial   #1; //Method java/lang/Object."<init>":()V
   4:   return
public static void testOne(int);
  Code:
   0:   iload_0
   1:   bipush  15
   3:   if_icmpgt       11
   6:   bipush  15
   8:   invokestatic    #2; //Method java/lang/System.exit:(I)V
   11:  return
public static void testTwo(int);
  Code:
   0:   iload_0
   1:   bipush  16
   3:   if_icmpge       11
   6:   bipush  16
   8:   invokestatic    #2; //Method java/lang/System.exit:(I)V
   11:  return
}As we can see, a<=15 generates an "if_icmpgt" bytecode, where a<16 generates "if_icmpge". Whether there's any difference between these or not depends (as others have noted) on how the JVM implements the bytecodes, on how HotSpot compiles, and on the generated assembler and the architecture of the machine you're running on.
The net? The literal answer to your question is "if_icmpgt vs if_icmpge". But if you're asking if there's any noticeable runtime difference - there are too many variables to tell.
Grant

Similar Messages

  • Is there any difference between R/3 4.7 version and ECC 5.0????

    Hi All,
      Is there any difference between R/3 4.7 version and ECC 5.0 for the transaction RSA5.
    Regards,
    Andy

    Andy
    Functionality wise I didn't see any difference other than new datasources in ECC5.0
    Thnaks
    Sat

  • Any difference between distinct and aggregate function in sql query cost???

    Hi,
    I have executed many sql stmts patterns- such as:
    a) using a single table
    b) using two tables, using simple joins or outer joins
    but i have not noticed any difference in sql stmts in cost and in execution plan....
    Anyway, my colleague insists on that using aggregate function is less costly compared to
    distinct....(something i have not confirmed, that's why i beleive that they are exactly the same...)
    For the above reffered 1st sql pattern.. we could for example use
    select distinct deptno
    from emp
    select count(*), deptno
    from emp
    group by deptno select distinct owner, object_type from all_objects
    select count(*), owner, object_type from all_objects
    group by owner, object_typeHave you found any difference between the two ever...????
    Note: I use Ora DB 10g v2.
    Thank you,
    Sim

    distinct and aggregate function are for different uses and may give same result but if u r using aggregate function to get distinct records, it will be expensive...
    ex
    select distinct deptno from scott.dept;
    Statistics
    0 recursive calls
    0 db block gets
    2 consistent gets
    0 physical reads
    0 redo size
    584 bytes sent via SQL*Net to client
    488 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    4 rows processed
    select deptno from scott.emp group by deptno;
    Statistics
    307 recursive calls
    0 db block gets
    60 consistent gets
    6 physical reads
    0 redo size
    576 bytes sent via SQL*Net to client
    488 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    6 sorts (memory)
    0 sorts (disk)
    3 rows processed
    Nimish Garg
    Software Developer
    *(Oracle & ASP.NET)*
    Indiamart Intermesh Limited, Noida
    To Get Free Oracle & ASP.NET Code Snippets
    Follow: http://nimishgarg.blogspot.com

  • Are there any differences between using Adobe Illustrator on a MAC and on a PC?

    Hello,
    I'm about go enroll in a class specialized for teaching Adobe Illustrator in order to be able to use the program at work.  The company that I work at uses Macintosh computers to deal with clerical work and everything, so I would like to know if there are any differences between using Adobe Ilustrator on a MAC and on a PC.  The school that offers training teaches two types of classes, where one uses Illustrator on a MAC, and the other one on a PC.  The PC class is able to have an earlier start date, which is why I'm sort of leaning towards choosing that class as I need to be able to use the software as soon as possible, but if there are main differences between the interface that will affect my knowledge of using Illustrator on a MAC after I take the class with Windows systems, then I will most likely be waiting for the class teaching in MAC systems.
    Thanks in advance for the help!
    Oh and another suggestion- should I take the Illustrator class in CS6 or CS5?

    Reading through the CS5 vs CS6 performance thread, the Mac version seems to have worse performance than Windows version.  From a starter's perspective the differences would most likely never be realized.  It will take some time to see differences between even CS5 and CS6 other than the visual aspect of course.
    Definitely take the CS6 versionso you can say you have it.  CS5 is my preferred version, CS6 is garbage with the bugs it has for the type of work I use it for.

  • Any differences between inner join and join without any keyword(inner join)

    Are there any differences between following two join statements?
    Join Statement 1:
    select column1, column2 from table1 t1, table2 t2 where t1.t1Key=t2.t2Key;
    Join Statement 2:
    select column1, column2 from table1 t1 inner join table2 t2 on t1.t1Key = t2.t2Key;
    Thanks for your reply.
    Kevin

    Hi, Kevin,
    user13531850 wrote:
    Are there any differences between following two join statements?To the system, those two are equivalent. They will produce exactly the same results, and will probably result in the same execution plan, so they will be equally efficient.
    Some people find it easier to read and understand one rather than the other. Personally, I find the ANSI syntax (JOIN ... ON ...) easier to understand. The join conditions that apply to each table are listed right next to the table; you don't have to hunt through a long WHERE clause to find them. Also, it makes debugging easier. If you forget the join condition, then you get a syntax error, pinpointing where you forgot the join condition. Using the old syntax, if you forget a join condition, you get a cross-join, and it may not be obvious that any error occurred, but even if you do notice the mistake, you have no clue where it happened.
    Join Statement 1:
    select column1, column2 from table1 t1, table2 t2 where t1.t1Key=t2.t2Key;This is the old join syntax. It works in all versions of Oracle (so far).
    Join Statement 2:
    select column1, column2 from table1 t1 inner join table2 t2 on t1.t1Key = t2.t2Key;This is the ANSI join syntax. It works in Oracle 9.1 and higher. The keyword INNER is optional.

  • There's any difference between the 2 ways

    i need to update specific infotype record.
    there's 2 ways:
    1) update the specific record the disadventage is that
       the update doesn't pass sap date check from the screen.
       in addition, i can't use batch input because while i
       lock the employee i need to update other record.  
    2) from dynamic event in modify record.
       in this way it's pass sap date check ? ?
    for finally, is there any difference between the 2 ways ?

    Hi,
    If you use the BAPIs 'BAPI_EMPLOYEE_ENQUEUE' & 'BAPI_EMPLOYEE_DEQUEUE'
    before and after each function call to 'HR_INFOTYPE_OPERATION', you should be able to update mutiples infotype records for the same employee in a single Program.
    2). Are you referring to Dynamic Actions?
    Regards,
    Suresh Datti

  • Is there any difference between Regular SAP Cert / SAP TechEd Cert

    Hello All,
    I need to appear for the following Certification:
    SAP Consultant Certification Technology Consultant SAP NetWeaver‘04 - SAP Web AS for ORACLE (WAS 620, Oracle 9)
    Is there any difference between regular SAP certification and Certification at TechEd (- except certification costs)
    Regards,
    Ammey Kesarkar

    No. It is just the certification exam is offered at SAP Tech Ed event.
    Regards,
    Jai Shankar

  • Is there any difference between the 2 different USB cords when syncing???

    I know this may be a paranoid question to ask but I just wanted to make sure.
    Is there any difference between the newer USB cords with the shorter plug (the end that goes into the iPhone) and the older ones with the bigger, square-shaped plugs that you can pinch on the sides to retract?
    Is there a difference in transfer speed, syncing speed, or reliability, or build quality?
    Just asking cuz the newer USB cord that came with my iPhone 3GS is getting frayed and so I'm using the older one instead.
    Thanks to whoever helps.

    No difference except, as you noted, you have to squeeze the older one to remove it. It's important that you do that so you don't damage it or the iPod.

  • HT1604 Is there any difference between Mac OS Extended Format and ExFat?

    Is there any difference between Mac OS Extended Format and ExFat?  I read in a blog that the ExFat was a good way to format an external drive because it avoided many of the pitfalls of the other formats, as long as it is supported by the operating system.  I tried to format my new Seagate drive, and got an invalid option error.  I was able to format it in Mac OS Extended format.  Can you please tell me if this is similar to ExFat.  Thanks.

    The Mac OS format can only be natively read to and written to by a computer running the Mac OS. This creates a problem if the user wishes his external, or other drive to have seamless compatibility between two different OS's, such as Windows and Mac. Yes, there are software solutions that enable a Windows PC to work with a drive formatted as Mac OS, but it gets complicated if you wish that drive to have compatibility "on the fly" with any PC you may encounter.
    It turns out that the format known as ExFAT is able to be natively read by both a Mac and a PC, without running any additional drivers on either machine. ExFAT also doesn't have some of the limitations of FAT32, which both OS's will also read/write.
    ExFAt is not perfect though. Formatting the drive as Mac OS Extended has some advantages on a Mac. First, it is the only format that permits all functionality of the Mac OS, such as using the drive for Time Machine.
    ExFAt is often thought of as the best middleground for an external partition/drive that needs to have easy cross platform compatibility between a Mac and  PC running Vista or Windows 7.

  • Is there any difference between the digital connection cables?

    Is there any difference between digital connection cables that connect to the back of a computer?  I've seen some with two groups of nine pins and a blade.  I've seen some with a solid group of 27 pins.  I've seen the blade pin and the four pin.  I currently run one that has two groups of nine pins with a blade pin.  I use it for DVI and it does ok.  I wanted to look into the HDMI cable and see how or if things would be different.  I bought a cable that has the 27 pin connector with a blade.  It physically connects but there is no signal.  I checked the monitor and I set it first to HDMI and then tried AUTO.  It made no difference.  I powered it all down and restarted it all and there was no difference.  Do I need to keep looking for a cable that has the same design connection to the PC but has the HDMI connection on the other end.  I may have this info wrong.  I just know I have two large connections at the time but the last cable I tried had one large connector and one that looked like an advanced USB design.  And then is there really any gain between the two as far as video quality or response?

    There are several type of connectors/cables with different effect.
    VGA
    DVI
    HDMI
    To understand more, I would say please look it up.
    Wish you luck,
    Karthik
    --Say "Thanks" by clicking the Kudos (purple thumbs up icon in the lower right corner of a post)
    --Please mark the post that solves your problem as "Accepted Solution"

  • Is there Any difference Between OBPM 10g And AlBPM 6.0

    Hello Friends
    I would like know is There any difference between the Oracle BPM 10g and ALBPM 6.0 . ??
    The second one is Difference between AlBPM5.7 and ALBPM 6.0
    Thanks In Advance
    with Regards
    Sandeep
    Edited by: user12036530 on Oct 18, 2009 9:08 PM

    For 10g Differences, check out: http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/upgradeguide/deliverables/upgrade_guide/c_Head_Reference.html
    And other 10g Documentation: http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/index.html Specifically: Upgrade Guide, Process API Differences (if you use PAPI)
    For 6.0 Differences, check out the Documentation: http://download.oracle.com/docs/cd/E13165_01/albsi/docs60/index.html Specifically: ALBPM 6.0 New Features Overview
    Hope this helps,
    -Kevin

  • Is there any difference between iMacs with Core i5 that come with Lion factory installed or not?

    I bought two Imacs (2.5GHz Intel Core i5) recently, and asked for the latest model carrying Core i5. One came with Lion installed, and now that I unpack the second one, it has Mac OS X 10.6.7 installed. I want to make a complaint, but I don't know if I should only ask the dealer to install Lion on the machine, or to change the machine. Someone can tell me if there's any difference between the pre-customary-Lion installation models and previous ones? Is there any way to know certainly that two machines are exactly the same? Please, help.

    I want to make a complaint
    I wouldn't complain, I would be happy. Macs capable of running Snow Leopard are more valuable.
    Your Snow Leopard Macintosh can always be upgraded to Lion later.  But many who have Lion want Snow Leopard, but this can be difficult.
    You have the best of both worlds.
    Just search this forum (or the Internet) for:  Downgrade Lion to Snow Leopard.

  • If I want to buy the iPad Air from US although I'm from Hong Kong, is there any difference between buying in Apple Store and in BestBuy ?

    If I want to buy the iPad Air from US although I'm from Hong Kong, is there any difference between buying in Apple Store and in BestBuy ?
    E.g. I buy it in BestBuy, I still can take the iPad Air to the genius bar if there are problems for the iPad?
    Thanks!

    Yes, as long as you buy a new device from an Apple Authorized reseller (which BestBuy is) then you have the normal Apple one year warranty with it.  Apple will honor that warranty in any of their stores, and anyone with any Apple device is welcome in any Apple retail store with questions or seeking help.

  • I'm currently living in Japan. Is there any difference between the US iPad(wifi) and a Japanese iPad(wifi)? Or should I wait till I visit the States to pick one up?

    I'm thinking of buying a new iPad3 but I'm currently living in the Japan. Is there any difference between the US and the Japanese iPad (wifi version)? If so, what are the differences?
    Thanks,
    -F

    Hi, I just watched the video for the Microcell and you have to use your broadband connection to get it to work and the problem is my broadband connection is down the times I'm using my 3G. That's why I use it, because my broadband connection is not working so much of the time.
    Any other suggestions? :-)
    Martha

  • Is there any difference between an HP Photosmart 7510 and 7520?

    Is there any difference between the HP Photosmart 7510 printer and the 7520?
    I have tried asking HP. They were not able to help. Presales advice for domestic customers appears to be virtually non existent in the UK.
    All  I know is that Argos deal with Ingram Micro to get the 7520.
    Is the 7520 just a marketing ploy - selling the same product for a different price? 

    Yes there is a difference. They are not the same; however, they are based on the same platform (engine).   The 7520 is the newer model which just replaced the 7510. 
    The main differences is the 7520 includes a hardware fax  built-in whereas the 7510 used the efax utility in order to send faxes.  This essentially allows you to fax directly from one fax machine to another without using a server based method.
    Other features on the 7520 include addition of a Scan to email feature as well as the addition of a USB 2.0 port on the front of the printer.
    You can find the complete 7520 product specs on the hp website: 
    http://shopping.hp.com/en_US/home-office/-/products/Printers/HP-Photosmart/CZ045A?HP-Photosmart-7520...
    Though I work for HP, My posts express MY opinion, and not those of HP.

Maybe you are looking for