Reputation: 935
I have a demo project-named A having a class Class AA. and I have another demo project-named B having a class Class BB. My question is how can I import ClassBB in class AA??????
Upvotes: 4
Views: 23448
Reputation: 1561
You have to define a dependency from you project A to project B.
In eclipse, make a right-click on project A and select "Propeties". Then, in "Java build Path", choose the "Project" tab. Click on the "Add" button and select project B. Validate, and you'll be able to import class BB in class AA
Upvotes: 0
Reputation: 19185
Add Project B in A's build Path. If you are using Eclipse. Right Click on Project->Java Build Paht->Projects->Add
Upvotes: 1
Reputation: 757
What you have to do is to add project A to project B's build path. Check this thread if you are working with eclipse: import from another java project in eclipse
right click on project b's folder in eclipse --> properties --> build path --> projects --> add.
Upvotes: 11