Results 1 to 3 of 3

Thread: Jvm

  1. #1
    maya700 is offline Member
    Join Date
    Jun 2010
    Posts
    45
    Rep Power
    0

    Default Jvm

    Hi All,

    Every where am reading that JVM converts bytecode into something my underlying platform or os can understand and run my java program. My first question is what is this something?? Is it a Machine code?? And second question is that when i compile my program which creates a .class file for me and then when i run it is that when JVM comes in and starts converting the bytecodes present inside .class file into machine code or something?????


    Thanks.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,445
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by maya700 View Post
    Every where am reading that JVM converts bytecode into something my underlying platform or os can understand and run my java program. My first question is what is this something?? Is it a Machine code?? And second question is that when i compile my program which creates a .class file for me and then when i run it is that when JVM comes in and starts converting the bytecodes present inside .class file into machine code or something?????
    Yep, that's exactly what happens: a JIT (Just In Time) compiler compiles the byte code from the .class file to machine code instructions. A 'HotSpot' mechanism controls which part are to be compiled by this JIT compiler and what parts are to be interpreted. Nowadays (almost) everything is compiled to machine code; and it is heavily optimised too so it can run amazingly fast (frequently faster than machine code generated by a classic compiler/linker).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    maya700 is offline Member
    Join Date
    Jun 2010
    Posts
    45
    Rep Power
    0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •