013-003-001

LocalDate Class: Date Creation

Easy

Problem Description

LocalDate class: Date Creation

In this problem, you will create a program that reads year, month, and day as integer inputs, constructs a date object using LocalDate.of(year, month, day), and displays the date and each field value to standard output.

Learning Objective: Create date with LocalDate.of()

Create program that builds date object from specified year, month, day. Use LocalDate class of method to create date.

Input

Line 1: Year (integer)
Line 2: Month (integer)
Line 3: Day (integer)

Output

Date: [yyyy-MM-dd]
Year: [year]
Month: [month]
Day: [day]

Test Cases

※ Output examples follow programming industry standards

Normal case
Input:
2025
1
15
Expected Output:
Date: 2025-01-15
Year: 2025
Month: 1
Day: 15
Boundary case
Input:
2024
2
29
Expected Output:
Date: 2024-02-29
Year: 2024
Month: 2
Day: 29

Your Solution

Current Mode: My Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here

sc.close();
}
}
0 B / 5 MB

You have 10 free executions remaining