forked from codehouseindia/Java-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompareDate2.java
More file actions
18 lines (17 loc) · 625 Bytes
/
CompareDate2.java
File metadata and controls
18 lines (17 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.Scanner;
class CompareDate2
{
public static void main(String args[])
{
String date1,date2;
Scanner sc=new Scanner(System.in);
date1= sc.next();
date2 = sc.next();
String arr1[] = date1.split('\');
String arr2[] = date2.split('-');
String arr3[]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
if(arr1[0].equals(arr2[0])&&Integer.parseInt(arr1[1])==arr3[Integer.parseInt(arr2[1]-1)]&&arr1[2].equals(arr2[2]))
System.out.println("Same");
else System.out.println("Different");
}
}