Last active
April 14, 2019 22:59
-
-
Save luisenriquecorona/6aa030cac28273d77837238df4e0edf9 to your computer and use it in GitHub Desktop.
Java.util.date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
/** Demonstrate deprecation warning */ | |
public class Deprec { | |
public static void main(String[] av) { | |
// Create a Date object for May 5, 1986 | |
// EXPECT DEPRECATION WARNING | |
Date d = new Date(86, 04, 05); // May 5, 1986 | |
System.out.println("Date is " + d); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So, we follow orders. Recompile with -deprecation (if using Ant, use <javac
deprecation= 'true '...>) for details:
C:\javasrc>javac -deprecation Deprec.java
Deprec.java:10: warning: constructor Date(int,int,int) in class java.util.Date has
been deprecated
Date d = new Date(86, 04, 05); // May 5, 1986
^
1 warning
C:\javasrc>