javascript
Brief description  about Online courses   join in Online courses
View Shristy  Bhati 's Profile

Implementing two Packages

I am not being able to understand the concept of implementing two packages in java n using the command given below..
"import package1.package2.class_example;"
plz sort out this problem of mine..

Asked by Shristy Bhati | Apr 7, 2013 |  Reply now
Replies (1)
View Luvita Burgess 's Profile
Hi, package1 and package 2 are just folders. The same Car example you can create a folder package1 and inside package 1 create another folder package 2 and store Car.java in it. In CarImportPackage you need to "import package1.package2.*". In real life example package1 is generic package (say for example "music") and package2 is more specific (for example "pop music").
Apr 7, 2013