Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8990585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:31:52+00:00 2026-06-15T22:31:52+00:00

I have problem using Date in java, I have a string that represent a

  • 0

I have problem using Date in java,
I have a string that represent a date for example String date = “23/10/2012”;
and i have a function that get a date as parameter, for example

public void foo(Date date){...}

my problem is that Date constructor that accept a string is deprecated and i do not want to use
a deprecated object.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:31:53+00:00Added an answer on June 15, 2026 at 10:31 pm

    So, you look at the Javadoc for the deprecated method which specifies:

    Deprecated. As of JDK version 1.1, replaced by DateFormat.parse(String s).

    You then look up DateFormat.parse and proceed accordingly. You probably want to create a SimpleDateFormat – or better still, use Joda Time which is a much better date/time API.

    When a method is deprecated, it’s always a good idea to give an indication of what existing code should be migrated to, and ideally why the old method was deprecated. Follow this guidance when you deprecate your own methods… and whenever you try to use a deprecated method, check the documentation to see if it suggests a better alternative.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem using the string function erase with iterators. The function below
I have a problem using java.util.Calendar and commons-lang DateUtil The problem is that my
i have one problem when i sort the NSMutablearray using date and time wise.
i have problem using LIKE structure in DB2 : for example: select * from
I have this problem converting java.sql.Timestamp.toString back to java.sql.Timestamp . Given element = 2012-08-01
I have a problem during an insert in Oracle using Java and JDBC. The
I have a problem using a HolidayCalendar. It seems that the calendar is simply
I have the following date string: 2011-09-06T22:02:57-04:00 . The problem is the timezone, -04:00
I'm currently wrestling with an Oracle SQL DATE conversion problem using iBATIS from Java.
I have problem using arabic font for iOS. All fonts have the same render,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.