The
OCAJP study guide says that the following lines of code will throw a compiler error
import java.util.*;
import java.sql.*; //DOES NOT COMPILE
This is because the Date class is present in both util and sql packages and when the class is found in multiple packages,
Java gives you the compiler error: The type Date is ambiguous
But I have tried the following code and it does not throw any compiler error and gives the output "Welcome hi"
So is the book wrong?