The difference between Java-java, javax, org and Com.sun packs __java

Source: Internet
Author: User
Tags java se

Original: http://blog.csdn.net/ooppookid/article/details/51704792
java, javax, org, and Com.sun packages are all class packs provided by JDK and are all in Rt.jar. Rt.jar is the Java base Class library (a very important package in the Java Core framework),
Most of the features include Lang, and Rt.jar default is in the root ClassLoader loading path,
So it is superfluous to put it in classpath. The difference between them is as follows: 1. java.*

Java SE's standard library, as part of the Java standard, is an externally-committed Java development interface that is generally not easily modified to remain backward compatible. The implementation of all JDK, including other manufacturers (IBMJDK/HPJDK/OPENJDK), is the same on java.*. 2. javax.*

It is also part of the Java standard, but is not included in the standard library and is generally part of the standard library extension. Usually belong to a particular domain, not a generic API.
So the API is provided in an extended way to avoid too large a standard library of JDK. Of course, some of the early javax were later incorporated into the standard library, and all should belong to the new version of the JDK's standard library. For example, Jmx,java 5 was previously provided as an extension, but Jdk5 later became part of the standard library, and all javax.management were part of the JDK5 standard library. 3. com.sun.*

is the implementation class for Java.* and javax.* in Sun's hotspot virtual machine. Because it is included in RT, we can also call. But because it is not the interface that Sun is publicly committed to, it can be added or subtracted according to the requirements of the implementation, so it may be different in different versions of the hotspot, and it is not available in other JDK implementations, calling these classes may not be backward compatible, so it is generally not recommended. 4. org.*

is provided by the Enterprise or the organization Java class Library, most is not the Sun company provides, with com.sun.*, does not have the backward compatibility, will add or subtract according to need at any time. The more commonly used are the classes and interfaces of XML, Web pages, and servers provided by the consortium.

Related Article

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.