简体   繁体   中英

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM