Note: C:\...Driver2.java uses or overrides a deprecated API. Recompile with "-deprecation" for details.
how significant is this warning message? should i be worried about getting it fixed?
Printable View
Note: C:\...Driver2.java uses or overrides a deprecated API. Recompile with "-deprecation" for details.
how significant is this warning message? should i be worried about getting it fixed?
Yes :)
As it sais, recompile with -deprectation to see which method you uses that are deprecated, and look in the API if there are some replacement for that method. There usually are.
this is what i'm using:
Date x;
x = new Date(year, month, date);
apparently i need to use the Calendar.set(year,month,date) method... but how do i use it exactly? would "x" be still defined as type Date?
Take a look at GregorianCalendar. It might be a better solution. You can use the constructor just as you use the constructor in the Date class.
GregorianCalendar(int year, int month, int date)
And since it extends Calendar I think you've got what you need :)
but i need the date to be of type DATE... can i use the methods in GregorianCalendar but still maintain DATE?
You've got one method that might work (haven't tried it)
From the API
So create new instance of GregorianCalendar, with all the values, and then use getTime() on the instance and there's your Date object :)Code:public final Date getTime()
Gets this Calendar's current time.
it might be deprecated, but i'm bound to use the date type. but using:
int year, month, day;
Date something = new Date(year, month, day);
displaying the date again shows an entirely different date than what was inputted. huh?