A strange event about Date....

first of all, I have this method

public Date createDate(String StringDate){

int month = Integer.parseInt(StringDate.substring(0,2))-1;

int day = Integer.parseInt(StringDate.substring(3,5));

int year = Integer.parseInt(StringDate.substring(6,10));

aCalendar.set(year, month, day);

Date makeDate = aCalendar.getTime();

}

something strange happen when it try to save the time from aCalendar into makeDate

incompatible types

found: java.util.Date

required: Date

Date makeDate = aCalendar.getTime();

something wrong here?or I"M missing something.... I have import util.*; already as well as java.io.*...

[867 byte] By [saipkjaia] at [2007-9-29 23:11:52]
# 1
> > something wrong here?or I"M missing something.... I> have import util.*; already as well as java.io.*...You mean "import java.util.*", of course. Right? - MOD
duffymoa at 2007-7-16 3:36:36 > top of Java-index,Archived Forums,Portability & Platform Independence [Archive]...
# 2
You possibly have written a Date class yourself which is the one the compiler thinks you mean.just make java.util.Date makeDate = aCalendar.getTime();or rename your Date-classTSH
janko2000a at 2007-7-16 3:36:36 > top of Java-index,Archived Forums,Portability & Platform Independence [Archive]...
# 3
or you've imported java.sql.Date
dpza at 2007-7-16 3:36:36 > top of Java-index,Archived Forums,Portability & Platform Independence [Archive]...