Reputation: 55
ex:I want to define a class A in a package called ABC and import the class A in the package ABC to another package which has a class X?
Upvotes: 0
Views: 7659
Reputation: 11
I have not touched java in a while and I am not too familiar with it. Since no one else has commented yet, here is my 2 cents
In python importing from another class... you declare:
{filename}.{classname}.{thenthemoduleyouwanttouse()}
I would assume the same concept in java. Find a way to use object oriented programming.
Upvotes: 1
Reputation: 862
Simply declare at the top of your class:
import ABC.A
and you can now use the public methods and attributes of class A
Upvotes: 1