Differences between JDK1.4 and JDK1.6 in Linux

Source: Internet
Author: User
Article Title: differences between JDK and JDK in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

In Linux, I wrote a program with jdk 1.6. After compilation and packaging, everything went normal. In Windows, jdk 1.6 was used, and what is the incompatible compilation type, invalid magic number.

In Linux, we had to re-compile jdk 1.4.2 with the classic version, and we found two differences: 1. in 1.4.2, assert is keyword and cannot be used as assert (boolean expression) :( String), but can be used in 1.6.

During compilation under 1.4.2, the following error message is displayed: warning: as of release 1.4, assert is a keyword, and may not be used as an identifier, it is a semicolon error (in fact, the compiler treats assert as an identifier to handle the reported error ).

2. In 1.4.2, the override clone () method cannot be used as follows:

Public NewClass clone (){

...

Return NewClass;

}

This is allowed and convenient in 1.6.

Only 1.4.2

Public Object clone (){

...

Return ...;

}

So there is more than N forced type conversion.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.