Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Date reference is ambiguous

807599Mar 12 2007 — edited Mar 12 2007
Hello all,

I am using:
import java.util.Date.*;
import java.sql.*;[
/code]

and i am getting the following error...

reference to Date is ambiguous, both class java.sql.Date in java.sql and class java.util.Date in java.util match

I assume that my problem is that both of the imported libraries contain a Date function and its not sure which one its supposed to use.

I want to use the Date method from java.util.Date

here is how i currently code the line:

Date trialTime = new Date();

How do i attribute the Date() method to the java.util.Date library to make the line unambiguous?

Cheers,
McPhee                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 9 2007
Added on Mar 12 2007
5 comments
2,246 views