This is a simple Date Validity Program written in Java that checks whether a given date is valid or not.
The user enters a date in six-digit format (DDMMYY), and the program validates it by checking:
- Correct day range for each month
- Leap year and non-leap year conditions
- Valid month values
If the date is valid, it prints the date in a readable format along with “VALID DATE”.
Otherwise, it prints “INVALID DATE”.
This was my first Java project after learning Java in high school.
I built this program to practice:
- Conditional statements (
if-else) - String manipulation
- User input using
Scanner - Basic date logic and leap year calculation
This project represents my early learning phase in Java and my first step into writing logical programs independently.
- Java
Scannerclass for input - String conversion and substring operations
- Leap year checking
- Nested
if-elsestatements - Basic validation logic
- Make sure Java is installed on your system.
- Compile the program:
javac DatePrint.java