0

I have two distinct classes in my project called Calendar, from different packages.

Does Java have an import as syntax similar to Python?

i.e.: Something like this:

import package1.Calendar as p1.Calendar;
import package2.Calendar as p2.Calendar;    

So, down an the new statement later I can just use the shorthand:

p1.Calendar c1 = new p1.Calendar();

rather than the full blown alternative:

package1.Calendar c1 = new package1.Calendar();

The package names I have are far more verbose than this...

JGFMK
  • 8,425
  • 4
  • 58
  • 92

0 Answers0