stevenjackson121
stevenjackson121

Reputation: 520

How can you tell when a Java import statement uses wildcard matching?

I asked a previous question which is apparently a duplicate of this question. I always thought that asterisks were the only way to denote wildcard matching in import statements.

What causes either of the import statements

import android.util.Log; 

or

import android.os.Environment;

to be interpreted as patterns that could match multiple packages? Or is there some other definition of wildcard matching that I don't understand?

Please help!

Upvotes: 0

Views: 40

Answers (1)

Stephen C
Stephen C

Reputation: 719679

I always thought that asterisks were the only way to denote wildcard matching in import statements.

They are.

What causes either of the import statements import android.util.Log; or import android.os.Environment; to be interpreted as patterns that could match multiple packages?

Nothing. They are not.

Or is there some other definition of wildcard matching that I don't understand?

Not per se.

But looking at your other question, it seems like the real problem is with the classpath that is being used when InetAddress.java is being compiled.

Upvotes: 1

Related Questions