Java thousand asked _02 basic use (010) _java, javax, Sun, org package what is the difference

Source: Internet
Author: User
Tags java se

Click to enter _ more _java thousand ask

1, Java, javax, Sun, org package what is the difference

java, javax, org, and sun packages are all class packages provided by the JDK and are all in Rt.jar. Rt.jar is the Java base Class library (a very important package in the Java Core framework), which contains most of the functions of Lang, and Rt.jar default is in the load path of the root ClassLoader, so classpath is superfluous. The differences between them are specific as follows:
See the Java core Framework here: What is the Java core framework?

    • Java.*
      Java SE's standard library, which is part of the Java standard, is a externally-committed Java development interface that is generally backward compatible and is not easily modified. All JDK implementations, including those from other manufacturers, are the same on java.*.

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

    • com.sun.*
      is the implementation class for Java.* and javax.* in Sun's hotspot virtual machine. Because it is included in the RT, we can also invoke it. However, because it is not the interface of Sun's external commitment, it can be increased or decreased according to the needs of the implementation, so it may be different in different versions of the hotspot, and it is not in the other JDK implementations, calling these classes may not be backwards compatible, so it is generally not recommended.

    • org.omg.*
      Is the Java class Library provided by the Enterprise or the organization, most of it is not provided by Sun Company, with com.sun.*, do not have backward compatibility, will increase or decrease as needed. Among the more commonly used are the XML, Web pages, server classes, and interfaces provided by the website.

Java ask _02 Basic use (010) _java, javax, Sun, org package What is the difference

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.