Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-28-2008, 09:56 AM
Senior Member
 
Join Date: Nov 2007
Posts: 115
Rep Power: 0
ravian is on a distinguished road
Default getYear deprecated method
I want to get the current year and tried the following.

Code:
System.out.println(date.getYear());
I came to know that getYear() is deprecated and further more it returns 108 which does not makes sense. Please tell me a better way of doing this.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 01-28-2008, 11:35 AM
roots's Avatar
Moderator
 
Join Date: Jan 2008
Location: Dallas
Posts: 289
Rep Power: 3
roots is on a distinguished road
Default
Code:
System.out.println(Calendar.getInstance().get(Calendar.YEAR));
...
Please refer to the Date Java doc, how they have justified the depreciation.
__________________
dont worry newbie, we got you covered.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Method Help pringle New To Java 4 04-16-2008 02:23 PM
I need help with a deprecated program mikau New To Java 0 02-13-2008 10:34 AM
Using Deprecated Methods ravian New To Java 3 11-23-2007 08:58 PM
method size is deprecated oregon New To Java 4 08-05-2007 06:59 PM
method not abstract, does not override actionperformed method. Theman New To Java 1 05-08-2007 07:13 AM


All times are GMT +2. The time now is 06:29 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org