my i have wrote my code is like this but m not to get get proper out put
here is my code
System.out.println("Enter Date of Birth dd/mm/yyyy");
DataInputStream in=new DataInputStream(System.in);
String dob= in.readLine();
String[] dob1=dob.split("/");
int year=Integer.parseInt(dob1[2]);
int month=Integer.parseInt(dob1[1]);
int date=Integer.parseInt(dob1[0]);
System.out.println("Date : "+date+ "Month : "+month+" year :"+year);
Calendar cal = new GregorianCalendar(year,month,date);
int dayOfWeek =cal.DAY_OF_WEEK;
switch(dayOfWeek){
case 1:System.out.println("Sunday");break;
case 2:System.out.println("Monday");break;
case 3:System.out.println("Tuesday");break;
case 4:System.out.println("Webnesday");break;
case 5:System.out.println("Thursday");break;
case 6:System.out.println("Friday");break;
case 7:System.out.println("Saturday");break;
}
out put:
Enter Date of Birth dd/mm/yyyy
21/11/1985
Date : 21Month : 11 year :1985
Saturday
wich is total wrong ans please help to for this