• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

custom tag  RSS feed

 
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.
 
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
 
Marshal
Posts: 67164
169
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)
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!