0% found this document useful (0 votes)
9 views9 pages

Java Console Real-Time Clock Project

This document outlines a console-based digital clock project built in Java using Object-Oriented Programming principles. The clock continuously displays the current system time, updating every second, and aims to teach OOP concepts, real-time functionality, and user interruption handling. It concludes that the project serves as a foundation for more complex applications like digital clocks or alarm systems.

Uploaded by

mukeshthota2006
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views9 pages

Java Console Real-Time Clock Project

This document outlines a console-based digital clock project built in Java using Object-Oriented Programming principles. The clock continuously displays the current system time, updating every second, and aims to teach OOP concepts, real-time functionality, and user interruption handling. It concludes that the project serves as a foundation for more complex applications like digital clocks or alarm systems.

Uploaded by

mukeshthota2006
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Real Time Clock

Name : V. Sai
Roll num : 24XZ1A05B4
Introduction

 This project is a console-based digital clock built in Java using Object-


Oriented Programming principles.

 It continuously displays the current system time, updating every second


in the console window.
Objectives

• Apply Object-Oriented Programming (OOP) concepts in Java.


• Implement real-time functionality using loops and [Link]().
• Display current system time dynamically.
• Learn how to handle user interruptions.
Code
Import [Link];
import [Link];
import [Link];

public class IndiaTimeClock {


public static void main(String[] args) {
// Formatter for 12-hour format with AM/PM
DateTimeFormatter formatter = [Link](“hh:mm:ss a”);

// Timezone for India


While (true) {
// Get current time in India
ZonedDateTime indiaTime = [Link](indiaZone);

// Format time
String formattedTime = [Link](formatter);

// Display time on same line


[Link](“\r🕒 Current Time in India: “ + formattedTime);
Try {
[Link](1000);
} catch (InterruptedException e) {
[Link]€;
}
}
}
}
Output Example

 🕒 Current Time: 10:15:42


 🕒 Current Time: 10:15:43
 🕒 Current Time: 10:15:44
 🕒 Current Time: 10:15:45
 ... (updates every second)
Conclusion

 This console-based Clock project is a simple demonstration of OOP


concepts in Java.
 It helps beginners understand class structure, looping, and real-time
functionality.

 The project can be extended easily into more complex applications like
digital clocks or alarm systems.
Thank you

You might also like