hai guys , how does a parse method of a date class work, i am totally confused how does it work.
plz check out this program and plz help me how does the parse method works
public class DateProg { psnm(String args[]) { String date="050716" ParsePosition p = new ParsePosition(0); SimpleDateFormat sdate=new SimpleDateFormat("yyMMdd"); Date dt = sdate.parse(date,p); System.out.println(sdate.format(dt)); sdate.applyPattern("yyyyMMdd"); System.out.println(sdate.format(dt)); } }
Richard Anderson
Ranch Hand
Joined: May 20, 2005
Posts: 61
posted
0
So what results do you get when you run this program? I would change the method signature of your method to: public static void main (String[] args) and add a semicolon after 050716.