I use a java.util.Date object in my program like this: java.util.Date now= new java.util.Date(); int day=now.getDay(); but the compiler said: "ApplyForm.java": Warning #: 368 : method getDay() in class java.util.Date has been deprecated at line 129, column 11 and: Warning #: 369 : There have been deprecation warnings. Please consult the documentation for a better alternative so, what's the better alternative?
When you get a deprecation warning you should check out the API for that class, it usually provides an explanation. Here's what Date's API says about getDay(): "Deprecated. As of JDK version 1.1, replaced by Calendar.get(Calendar.DAY_OF_WEEK)." Jeff