The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

To me it is like...

Posted by Kishori Sharank on November 25, 2000 at 3:05 PM

import java.awt.* ; means , "Use any of the classes in package java.awt when they are needed. But it doen't imply that also use all the classes in the package java.awt.event"

import java.awt.event* ; means , "Use any of the classes in package java.awt.event when they are needed. But it doen't imply that also use all the classes in the package java.awt"
So writing import java.awt.* ; dosn't also include all the sub packages of java,awt. It only includes all the classes in java.awt package.
So, if you are using classes from both packages java.awt and java.awt.event then you must inlcude both lines else you program won't work.





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us