ITeye博客

(1)chaper 1: Introduction

zzy1943 · 2010-04-22 20:37 · inside JVM 读书笔记 · 编程语言 · Markdown

Three advantages: platform independence security network-mobility These three facets of java's architecture work together to make java suitable for the emerging networked computing environment.

The architecture: the java programming language the java class file format the java application programming interface(api) the java virtual machine

The Java Virtual Machine main job: to load class files and execute the bytecodes they contain. Execution engines are different depending on the implementation of JVM. But can divided into two kinds:

  1. (interpreter) interpret the bytecodes on at a time(slow but consume fewer memory)
  2. just-in-time compiler: bytecodes of method are compiled to native machine code the first time the method is invoked. The native code then is cached and be reused the next time be invoked.(fast but consume more memory) (java hotspot technology make a tradeoff between these two manners)

Native methods The way jvm communicate with the host machine. Native methods is store in a dynamically linked library whose exact form is platform specific.(.dll in windows, and .so in linux)

Software technology adopted by java programming language:

  1. object-orientation
  2. multi-thread
  3. structured error-handling
  4. garbage collection
  5. dynamic linking
  6. dynamic extension

Java and C/C++ Most compelling reasons for using java is that it can enhance developer productivity, and the main disadvantage is low execution speed.

  1. Java has restrictions on direct accessing of memory and require you strictly obey rules of type when working with objects. (casting type)
  2. Java adopted garbage collection to deal with the releasing of memory, and it is automatically done by JVM. C++ developers need to do this work with the delete() function by themselves.
  3. Java has run-time array bounds checking. (array is implemented as object in java). C++ has no such mechanism.
  4. JVM will check object reference every time they are used to make sure they are not null. But in c++, using of null reference can only program crash. But all these advantages are come from the tradeoff of lower speed.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。