The 11 advantages of Java -Why you choose this language

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.

时间: 2024-08-04 23:09:00

The 11 advantages of Java -Why you choose this language的相关文章

atitit.提升开发效率---使用服务器控件生命周期 asp.net 11个阶段 java jsf 的6个阶段比较

atitit.提升开发效率---使用服务器控件生命周期  asp.net 11个阶段  java jsf 的6个阶段比较 如下列举了服务器控件生命周期所要经历的11个阶段. (1)初始化-- --在此阶段中,主要完成两项工作:一.初始化在传入Web请求生命周期内所需的设置:二.跟踪视图状态.首先,页面框架通过默认方式引发Init事件, 并调用OnInit()方法,控件开发人员可以重写该方法为控件提供初始化逻辑.此后,页面框架将调用TrackViewState方法来跟踪视图状态. 需要注意的是:多

11 Buzzwords of JAVA

There are 11 Buzzwords of JAVA: 1. Simple; 2. Object-Oriented; 3. Network-Savvy; 4. Robust; 5. Secure; 6. Architecture-Neutral; 7. Portable; 8. Interpreted; 9. High-Performance; 10. Multithreaded; 11. Dynamic

2月11日 阿里巴巴Java开发手册 读后感

该手册分为几个部分: 印象深刻的几点: (五)集合处理 2.[强制]ArrayList的subList结果不可强转成ArrayList,否则会抛出ClassCastException 异常:java.util.RandomAccessSubList cannot be cast to java.util.ArrayList ; 说明:subList 返回的是 ArrayList 的内部类 SubList,并不是 ArrayList ,而是 ArrayList 的一个视图,对于SubList子列表

JUnit-4.11使用报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing错误

下载了最新的JUnit版本,是4.11,结果尝试使用发现总是报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing这样的错误,上网查了一下,一般的解决方案是,换一个低一点的版本就好了.还有人说,是缺少hamcrest的包.去官网又看了一下,结果发现这样一段话: junit.jar: Includes the Hamcrest classes. The simple all-in-one solution to get starte

工商银行 B2C1.0.0.11 PHP ecshop(JAVA) 接口

<?php if (!defined('IN_ECS')){    die('Hacking attempt');} $payment_lang = ROOT_PATH . 'languages/' . $GLOBALS['_CFG']['lang'] . '/payment/icbc.php'; if (file_exists($payment_lang)){    global $_LANG; include_once($payment_lang);} /** * 模块信息 */if (is

JUnit-4.11使用报java.lang.NoClassDefFoundError: org/h

今天尝试使用JUnit,下载了最新的JUnit版本,是4.11,结果尝试使用发现总是报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing这样的错误,上网查了一下,一般的解决方案是,换一个低一点的版本就好了.还有人说,是缺少hamcrest的包.去官网又看了一下,结果发现这样一段话: junit.jar: Includes the Hamcrest classes. The simple all-in-one solution t

031113_【第11章:Java常用类库】_比较器(Comparable、Comparator)

//****ComparatorDemo.java import java.util.* ;class Student{    // 指定类型为Student    private String name ;    private int age ;    public Student(String name,int age){        this.name = name ;        this.age = age ;    }    public boolean equals(Obje

2015.11.27初识java一集简单的java小程序

今天是来到汉企第二天,昨天主要学习了JAVA配置环境变量方法:1.打开我的电脑--属性--高级--环境变量 2.新建系统变量JAVA_HOME 和CLASSPATH 变量名:JAVA_HOME变量值:D:\Java\jdk1.7.0_60_x64(变量值必须为全英文路径,不能有中文) 变量名:CLASSPATH变量值:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;(完全复制即可)3. 选择“系统变量”中变量名为“Path”的环境变量,双击该

11.UiAutomator 相关JAVA知识

一.封装方法与模块化用例 1.方法: 在JAVA中,方法就好比日常生活中的一个动作,由动作组合成一系列完整的操作. 方法结构: 方法修饰符 方法返回值类型 方法名 { 方法体 } 比如: public void testDemo1{ UiDevice.getInstance().pressBack(); } 2.模块化用例: UI自动化用例为模拟手工动作用例 手工用例为一个个的动作组成 自动化用例也可以拆解成一个个动作组成 将每个动作抽象封装成方法,达到复用和简化维护的目的 示例: public