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
5. 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.
- 大小: 42.6 KB
- 大小: 21 KB
分享到:
相关推荐
数据库原理英文课件chaper1-theworldofdatabasesystems.ppt
Chaper 1:why get into streaming and digital media? chaper 2:technology primer: the basics of streamming and digital media chapter 3:the four keys to a profitable streaming or digital media business
Chapter 1: The Goals and Terminology of Software Engineering Chapter 2: Introduction to Quality and Metrics in Software Engineering PART II: Software Process Chapter 3: Software Process Chapter 4: ...
this is a good book for seo
gpu精粹三第一章讲解了基于gpu的地形渲软技术,值得一看!
Chaper3.Page19
chaper5Wecandoit学习课程.pptx
chaper5Wecandoit学习教案.pptx
twincat3 Chaper.7 ScopeView
Chapter 1: Game Design Origins Chapter 2: Gameplay Styles Chapter 3: Core Game Design Concepts Chapter 4: Visual Design Chapter 5: Detailed Development of Visuals Chapter 6: Navigation and Interfaces ...
twincat3 Chaper.8 Library_Manage
this is a good book for seo
this is a good book for seo
图像视觉领域的深度学习资料,手把手教你搭建自己的神经网络,让你从实践中深入浅出地学习各种经典神经网络知识。亲试不错,分享之!
this is a good book for seo
twincat3 Chaper.5 Simple_Program
大学生计算机基础\chaper 4-excel.老师讲课的PPT,欢迎大家下载!
twincat3 Chaper.6 PLC HMI
第 1 章Chaper 1系 统 思 考Seddon, 《Systems Thinking in the Public Sector》, 2008, 第70页。
阶段一模块三:常用类的概述和使用