Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 1st, 2005, 6:21 PM   #1
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
Java import.* question

quick question, i'm looking at a java program where it has the following import statements:

import java.awt.*;
import java.event.*;

I know i'm supposed to wrap that in code or something but hell, it's only 2 lines.

Anyways, why do we need to include the .event one? Shouldn't the first statement include event as well as all other classes of java.awt?
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Nov 1st, 2005, 8:49 PM   #2
andro
Professional Programmer
 
Join Date: Oct 2005
Location: California
Posts: 294
Rep Power: 3 andro is on a distinguished road
Send a message via AIM to andro
Assuming you meant
import java.awt.*;
import java.awt.event.*;

No. The imports don't recursively enter any of the other package directories. java.awt.* is everything that isn't a directory in the java.awt package.
andro is offline   Reply With Quote
Old Nov 1st, 2005, 10:54 PM   #3
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
Quote:
Originally Posted by andro
Assuming you meant
import java.awt.*;
import java.awt.event.*;

No. The imports don't recursively enter any of the other package directories. java.awt.* is everything that isn't a directory in the java.awt package.
heh, sorry, you got it right. so it only imports the packages in that directory, not any other ones. Hmm, ok, good to know.

If I did import java.awt.*.*;

would that recursively do it?
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Nov 2nd, 2005, 3:33 AM   #4
andro
Professional Programmer
 
Join Date: Oct 2005
Location: California
Posts: 294
Rep Power: 3 andro is on a distinguished road
Send a message via AIM to andro
It won't compile that way
andro is offline   Reply With Quote
Old Nov 2nd, 2005, 9:24 AM   #5
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
gotcha, thanks bro. appreciate it
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:52 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC