博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
The 11 advantages of Java -Why you choose this language
阅读量:7058 次
发布时间:2019-06-28

本文共 4810 字,大约阅读时间需要 16 分钟。

Java is never just a language.There are lots of programming languages out there, and few of them make much of a splash.Java is a whole platform, with a huge library, containing lots of reusable code, and an execution environment that provides services such as security, portabilit across operating systems, and automatic garbage collection.

   As a programmer, you will want a language with a pleasant syntax and comprehensible semantics(i.e., not C++). Java fits the bill, as do dozens of other fine languages. Some languages give you portability, garbage collection, and the like, but they don't have much of a library, forcing you to roll your own if you want fancy graphics or networking or database access. Well, Java has everything-- a good language, a high-quality execution environment, and a vast library. That combination is what makes Java an irresistible proposition to so many programmers.

1.Simple

  We wanted to build a system that could be programmed easily without a lot of esoteric training and which leveraged today's standar practice. So even though we found that C++ was unsuitable, we designed Java as closely to C++ as possible in oreder to make the system more comprenhesible. Java omits many rarely used, poorly understood, confusing features of C++ that, in out experience, bring more grief than benefit.

2.Object-Oriented

  The simple biggest difference between Java and C/C++ is that Java has a pointer model that eliminates the possibility of overwriting memory and corropting data.

 3.Network-savvy

   Java has an extensive library of outines for coping with TCP/IP protocols like HTTP and FTP. Java applications can open and access objects acros the Net via URLs wtih the same ease as when accessing a local file system.

4.Robust:

      Java is intented for writing programs that must be reliable in a variety of ways.

 5.Secure:

     Java is intended to be used in networked/distributed environments. Toward that end, a lot of emphasis has been placed on security. Java enables the construction of virus-free,tamper-free systems.

6.Architecture-Neutral

   The compiler generates an architecture-neutral object file format--the compiled code is excutable on many processors, given the presence of the Java runtime system. The Java compiler does this by generating bytecode instructions which have nothing to do with a particular computer architecture. Rather, they are desigened to be with both easy to interpret on any machine and easily translated into native machine code on the fly.

  Of course, interpreting bytecodes is necessarily slower than running machine instructions at full speed, so it isn't clear that this is even a good idea. However, virtual machines have the optin of translating the most frequently executed bytecode sequences into machine code-- a process called just-in-time compilation. This strategy has proven so effective that even Microsoft's .NET platform relies on the a vitural machine.

   Java's virtual machine has other advantages. It increase security because it can check the behavior of instrcution sequances. Some programs even produce bytecodes on the fly, dynamically enhancing the capabilities of a running program.

7.Portable

   Unlike C and C++, there are no "implementation-dependent" aspects of the specification. The sizes of the primitive data types are specified, as is the behavior of arithmetic on them. For example, an int in Java is always a 32-bit interger. In C/C++, int can mean a 16-bit integer, a 32-bit integer, or any other size that the compiler vendor likes. The only restriction is that the int type must have at least as many bytes as a short int and cannot have more bytes than a long int.

8.Interpreted

  The Java interpreter can execute Java bytecodes directly on any machine to which the interpreter has been ported. Since linking is a more incremental and lightweight process, the development process can be much more rapid and exploratory.

 

9.High-Performance

   While the performance of interpreted bytecodes is usually more than adequate, there are situations where higher performance is required. The bytecodes can be translated on the fly (at runtime) into machine code for the particular CPU the application is running on.

10.Multithreaded

   The benifits of multithreading are better interactive responsiveness and real-time behavior.

   Threads in Java can take advantage of multiprocessor systems if the base operating system does on.

11.Dynamic 

    In a number of ways, Java is a more dynamice language than C or C++. It was designed to adapt to a evolving environment. Libraries can freely add new methods and instance variables without any effect on their add new methods and instance variables without any effect on their clients. In Java, fingding out runtime type information is straighforward.

 

 

 

 

 

 

  

 

转载于:https://www.cnblogs.com/Micheal-G/p/4933519.html

你可能感兴趣的文章
I/O多路复用详解
查看>>
Linq使用Group By经验总结
查看>>
Ajax原生写法
查看>>
无线遥控器方案 Si4010/Si4012
查看>>
Hulu面试题
查看>>
On iPad, UIImagePickerController must be presented via UIPopoverController
查看>>
项目管理沟通计划
查看>>
IntelliJ IDEA 12.1.4 解决中文乱码
查看>>
据说每个大牛、小牛都应该有自己的库——DOM处理
查看>>
第一章 初识MVC4
查看>>
red ant
查看>>
树的子结构
查看>>
ireport常见问题
查看>>
Advanced Awk for Sysadmins
查看>>
动态Pivot(2)
查看>>
用MATLAB实现字符串分割
查看>>
EntityFramework ,ef 介绍
查看>>
C#代码 json类
查看>>
九度 1254:N皇后问题
查看>>
解决php收邮件乱码问题
查看>>