package statement and import statement difference?
Joined: Feb 03, 2002
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.
Joined: Nov 28, 2001
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