Skip to content

mkmishra2503/ticket-booking-system-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎟️ Ticket Booking System (Console Based - Core Java)

A console-based Ticket Booking System built using Core Java that demonstrates Multithreading and Synchronization to prevent overbooking when multiple users try booking tickets at the same time.


✅ Project Overview

This project simulates a real-world ticket booking scenario where multiple users book tickets concurrently.
To ensure correct booking and avoid race conditions, the system uses Java Threads with the synchronized keyword.


🚀 Features

✅ Multiple users booking at the same time (Concurrency)
✅ Ticket count is limited (Stock management)
✅ Prevents overbooking using synchronized
✅ Displays booking success/failure messages
✅ Simple and beginner-friendly core Java project


🛠️ Technologies & Concepts Used

  • Core Java
  • Multithreading
  • Synchronization (synchronized)
  • Thread Lifecycle
  • join() method
  • OOP Basics

📌 Requirements Implemented

  • Total Tickets = 10
  • Total Users = 16
  • Only 10 bookings should be successful ✅
  • Remaining users should see Failed booking due to no tickets ❌

📸 Screenshots

✅ Project Structure

Project Structure

✅ Main Code

Main Code

✅ Console Output

Console Output


📂 Folder Structure

ticket-booking-system-java/
│── src/
│   ├── (Java source files)
│
│── screenshots/
│   ├── console-output.png
│   ├── main-code.png
│   ├── project-structure.png
│
│── .gitignore
│── README.md

▶️ How to Run

git clone  https://github.com/mkmishra2503/ticket-booking-system-java.git

About

Console-based Ticket Booking System in Core Java using Multithreading and Synchronization to prevent overbooking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages