This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt reg classes in package?  RSS feed

 
mara thamizhan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I have a simple doubt!

We are importing packages like java.io.*; in our classes !

Can we see the classes,along with all their members & its definitions, which are there in the respective packages like java.io package etc.

cheers,
Bye!
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, buddy. Welcome to Java Ranch.

When you import a package that implies that instead of using the fully qualified name of the classes you can use their canonical name.

Therefore, if you do not import the java.io.* package classes, and you want to use FileInputStream (canonical name), you would be obliged to write java.io.FileInputStream (fully qualified name).

Now, what member of any of these classes are available has noting to do with your import statements. It depends on the members accessibility (public, protected, default or private).
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure that answers the question...

All those packages are documented in the online API documentation. Does that help?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!