Skip to content

YuriiJavaDev/JavaBasics_Task_210_V0.1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Secretary's Scheduler: Meeting Comparison (JavaBasics_Task_210_V0.1)

📖 Description

This project implements a fundamental scheduling logic for time-sensitive applications. It compares two specific time objects—a morning meeting and an afternoon presentation—to verify their chronological sequence. By utilizing the modern Java Time API, the application ensures that the earlier event is correctly identified and displayed to the user.

📋 Requirements Compliance

  • LocalTime Initialization: Sets meeting at 08:00 and presentation at 14:30.
  • Chronological Validation: Uses the isBefore() method to compare two LocalTime instances.
  • Dynamic Console Output: Prints a formatted string containing both time objects and their relation.
  • Goal: Understand boolean logic in time comparisons.

🚀 Architectural Stack

  • Java 8+ (java.time.LocalTime)

🏗️ Implementation Details

The application evaluates the expression meeting.isBefore(presentation). If true, it confirms that the meeting at 08:00 occurs before the presentation at 14:30. This approach is highly readable and avoids the common pitfalls of comparing raw hours and minutes as primitive integers.

📋 Expected result

Meeting at 08:00 is before presentation at 14:30

💻 Code Example

Project Structure:

src/com/yurii/pavlenko/
                └── Solution.java

Code

package com.yurii.pavlenko;

import java.time.LocalTime;

public class Solution {

    public static void main(String[] args) {

        LocalTime meeting = LocalTime.of(8, 0);
        LocalTime presentation = LocalTime.of(14, 30);

        if (meeting.isBefore(presentation)) {
            System.out.println("Meeting at " + meeting + " is before " + "presentation at " + presentation);
        } else {
            System.out.println("Presentation at " + presentation + " is before " + "meeting at " + meeting);
        }
    }
}

⚖️ License

This project is licensed under the MIT License.

Copyright (c) 2026 Yurii Pavlenko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...

License: MIT

About

This is a tutorial project. JavaBasics_Task_210_V0.1 Schedule management logic: comparing meeting times using LocalTime.isBefore() for chronological validation. 040326_1721

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages