Leonardo Aoun
Leonardo Aoun

Reputation: 62

Importing different classes from a package in java

I know we can do import p.*; to import every class located in package p. But let's say p contains classes A, B and C, and we only want to import A and B, can we do something else than:

import p.A;
import p.B;

like import p.{A, B} in Scala?

Upvotes: 0

Views: 56

Answers (1)

tgdavies
tgdavies

Reputation: 11411

No, there is no equivalent for Java, you will need to enumerate each class.

Upvotes: 5

Related Questions