• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to display All packages at a time..

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ,
How to disply all packages at a time in console or browser.plz help me
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "all packages"? Do you mean all of the packages named in a series of import statements?
And, not to make light of your question, why on earth would you want to do that?
PCS
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Open the source file (src.zip) in WinZip or whatever?
I am not sure what you are trying to accomplish.
 
Sanju
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi frineds...
Thank you for your reply...All packages mean All import packages disply at consorl or Browser.How is it?plz help me
 
Philip Shanks
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think you can display all of the packages named in the import statements.
Just because you name a class in the import statement, doesn't mean it gets automatically loaded into the virtual machine.
I can't think of any way that the main thread can know what packages are named in the import statements. I think that the default system classloader would have to have access to that information, but an examination of the API reveals no public methods that would allow you to access it.
Nice try... please post if you figure out how to do this (although I don't see much utility in it, it might be a nice academic exercise).
PCS
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Philip Shanks:
I can't think of any way that the main thread can know what packages are named in the import statements. I think that the default system classloader would have to have access to that information, but an examination of the API reveals no public methods that would allow you to access it.


The classloader doesn't have access to that information, because that information isn't part of the class file! Import statements get resolved at compile time - they are just a convenience for programmers, so that you don't have to type fully qualified classnames everywhere.
With other words

will produce identical byte code to
reply
    Bookmark Topic Watch Topic
  • New Topic