Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 4th, 2004, 02:45 AM
info_spider info_spider is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 info_spider User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Question about java

When using the import command, I've seen statements like the following:

import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;


If the * sign indicates to import everything below the import.javax.servlet.jsp classes, why do they have to also put another line below to import everything under the javax.servlet.jsp.tagext.* as well?

Shouldn't that be included in the first import, since the * sign was used to indicate everything under the jsp directory, including jsp.tagext.*? Do java programmers do this just for ilustration purposes so whoever looks at the code knows they are using something from the tagext directory? or is is really neccessary to include the second line?

I am confused....


Reply With Quote
  #2  
Old February 4th, 2004, 08:55 AM
Ludootje Ludootje is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 49 Ludootje User rank is Corporal (100 - 500 Reputation Level)Ludootje User rank is Corporal (100 - 500 Reputation Level)Ludootje User rank is Corporal (100 - 500 Reputation Level)Ludootje User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 34 m 3 sec
Reputation Power: 9
First, I'm not 100% sure of my explanation, it's just what I think the reason is. I'm not a Java programmer.

If you only use
import javax.servlet.jsp.*;
then afterwards you want to use foobar which is in tagext, you'll need to use
tagext.foobar blahblah

But if you do:
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
You can simply use:
foobar blahblah

Get it?

Again, I'm not sure of this, maybe someone can confirm it?

edit: some -> someone (sometimes my head thinks one thing, and my fingers type another)
__________________
Disclaimer: the owner of this post is NOT responsible for any moral and/or physical damage this post could cause to you.

Last edited by Ludootje : February 7th, 2004 at 05:17 AM.

Reply With Quote
  #3  
Old February 6th, 2004, 04:34 PM
info_spider info_spider is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 info_spider User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks a lot !!!

I got it now

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Question about java


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT