• Post Reply Bookmark Topic Watch Topic
  • New Topic

custom tag  RSS feed

 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends,

while developing the taghandler class we are importing the following packages


i am confused second line in the above code as why importing the second package it is already available to us when import the package in the first line. second package is subpackage of first one so no need to import.but here did.

anybody can clarify my doubt,please?

cheers,
babu.
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey babu,
Go to the basics of Java, man. if you import one package the subpackages are not imported.

so if package structure is A.B
A(package)
|
|--X(class)
|--Y(class)
|--Z(class)
|-----B(subpackage)
|
|--P
|--Q
|--R

A contains classes X,Y,Z & B contains classes P,Q,R(shown above)
if you say
import A;//will import X,Y & Z (& not P,Q,R)
import A.B;//will import P,Q & R

I hope this helps otherwise refer any Java Basic Book for more details.
Shrinivas
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to Java in General (beginner)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!