We import the packages from java.somepackge.*; or javax.package.*;package can be anything from javas own api or other external api.

My question is what is difference between java and javax?

They are different packages with different classes. If you want a class that is inside java.package then import java, or else import javax.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.