Wednesday, November 16, 2016

Core Java Notes[(session2)]


  1. Execution Process c and cpp program
  2. *if we develop any program it has to undergo 2 phases

  3. i)compilation
  4. ii)execution

  5. if we compile a c/cpp program we get an intermediate code called as .obj file.

  6. *we execute or convert .obj into .exe using a program called Linker.

  7. *.exe is when executed provides output.


  8. Here either .obj or .exe of one os cannot be executed on other os,so c/cpp are platform dependent.


  9. .c/.cpp-->compile-->.obj-->Linker-->.exe



  10. Execution Process of a java program


  11. .java--->comiple-->.class[bytecode]--->Jvm-->o/p
  12.                                        Jit

  13. *we save a java program using the extension .java

  14. *Execution of a java program undergoes 2 phases

  15. i)compilation
  16. ii)execution

  17. i)compilation

  18. *if we compile a .java program we get .class[bytecode]

  19. .java-->compiled-->.class[bytecode]

  20. *once we get a .class again we should convert bytecode to machine code using jvm[java virtual machine]

  21. *Jvm is a program which helps in converting bc to mc

  22. .class-->jvm-->o/p

  23. *.class is platform independent code,we can execute the .class file of one os on another os.

  24. *.class is interpreted by jvm so jvm is also called as bytecode interpretor.

  25. *jvm is platform dependent bcoz every os should have a seperate jvm.

  26. what is JIT compiler?

  27. It is a helper application of jvm which helps jvm to convert byte code to mahcine code together.


  28. .java-->compile-->.class-->jvm-->o/p. 



No comments: