I know how inheritance, composition, aggregation etc... can be implemented in Java and drawn in UML. But if class A imports class B, how do we note this in UML? Are the two classes associated in any way in a class diagram, if so in what way?
Example
import com.example.Book;
public class Library {
public void doSomething(Book book) {
// ...
}
}
You don't represent it.
The import simply denotes some syntactic sugar so that so that you don't have to refer to every class with its full qualified name. Thereby it makes the code easier to read and write.
They are optional and have no bearing on the model representation of your class, which is what you are documenting with UML.