Results 1 to 7 of 7

Thread: warning

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    103

    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?

  2. #2
    Lively Member
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    115
    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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    103
    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?

  4. #4
    Lively Member
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    115
    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

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    103
    but i need the date to be of type DATE... can i use the methods in GregorianCalendar but still maintain DATE?

  6. #6
    Lively Member
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    115
    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

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    103
    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
  •  



Click Here to Expand Forum to Full Width