Is there any reason for the separation of java and javax packages?

14

In the java documentation , there are several packages organized within the java and javax packages, for the most part. There are even some packages that seem to be duplicates, such as java.sql and javax.sql . Is there any explanation for this separation?

    
asked by anonymous 17.03.2017 / 12:18

2 answers

11

The separation between these packages is for a better organization. The java package is more basic and the javax package is extra, enhanced functionality that can make use of pure java classes or not.

The classes of the java package are older, whereas the javax classes are extensions. Note that in the sql case, if you are to parse the javadoc of a javax class, it must also contain import for the basic java classes you are taking, add extra features. Already seeing the javadoc of a pure java package class, you will not find class imports from the javax package.

In short, javax complements the pure java classes.

    
17.03.2017 / 12:54
4

Following the Stack reasoning line available here:

javax vs java package

Historically speaking:

One of the reasons for this was NETSCAPE , it limited some packages that were available in the JAVA PACKAGE

Today, for the community at least, the javax / java point has been lost, since everything that exists in javax practically already exists in java.

Note: Excerpts from the stack's responses from the link provided

    
17.03.2017 / 12:49