I have written the code to spit the string i.e birthdate,I want to store it in 3 different vaiables how to do it. (Mday=1,Mmonth=1,MYear=2011).I am getting birtdate dynamically.also I am getting values in token.
StringTokenizer st = new StringTokenizer(BirtDate, "/");
while (st.hasMoreElements()) {
String token = st.nextToken();
System.out.println("Token = " + token);
}
One better way could be to use date formatter and object as below:
Please note: Month starts from 0, so you may want to add 1.