File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package statement and import statement difference?

 
Krystal Tyler
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a beginner and I still can't rule out what is the difference between what a package statement does and an import statement.
 
Arun Boraiah
Ranch Hand
Posts: 233
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I just want to give a example
package is just like a bag. Where you place items.
say you have placed some books, pen, pencil etc in a bag.
here books,pen,pencil are java code.
now even i have a bag with same/different items and assume both of our bags are placed next to each other.
A third party want to make use of your items. How do he refer's.
For that he calls your bag name with item he wants to use. for this to happen he uses "import" .
package is to define your bag name. And import is to use the content of the bag.
Hope this help. All the best
-arun
 
Krystal Tyler
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for analogy. I understand now!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic