|
-
Apr 30th, 2003, 05:16 AM
#1
Thread Starter
Lively Member
warning
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?
-
Apr 30th, 2003, 06:18 AM
#2
Lively Member
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.
-
Apr 30th, 2003, 06:47 AM
#3
Thread Starter
Lively Member
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?
-
Apr 30th, 2003, 07:04 AM
#4
Lively Member
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
-
Apr 30th, 2003, 07:12 AM
#5
Thread Starter
Lively Member
but i need the date to be of type DATE... can i use the methods in GregorianCalendar but still maintain DATE?
-
Apr 30th, 2003, 07:17 AM
#6
Lively Member
You've got one method that might work (haven't tried it)
From the API
Code:
public final Date getTime()
Gets this Calendar's current time.
So create new instance of GregorianCalendar, with all the values, and then use getTime() on the instance and there's your Date object
-
Apr 30th, 2003, 07:55 PM
#7
Thread Starter
Lively Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|