GitHunt
YO

yogeshkumarsaini/Phonebook-Application

Java OOP-based phonebook with search, favorites, grouping, CRUD & file storage

๐Ÿ“ฑ Phonebook Application

A feature-rich console-based Phonebook application built using Java, OOP, Collections, and File Handling.
It allows users to manage contacts efficiently with sorting, searching, grouping, favorites, and persistent storage.


โœจ Features

โœ… Add new contact
โœ… View all contacts (sorted Aโ€“Z)
โœ… ๐Ÿ”  Group contacts by first letter
โœ… ๐Ÿ” Search by name
โœ… ๐Ÿ“ฑ Search by phone number
โœ… โญ Mark contacts as favorite
โœ… ๐Ÿ” Update contact
โœ… โŒ Delete contact
โœ… ๐Ÿ“Œ Indian phone number validation
โœ… ๐Ÿ’พ Data stored using file handling
โœ… ๐Ÿงฑ Object-Oriented design
โœ… ๐Ÿ“‹ Menu-driven interface


๐Ÿ—๏ธ Project Structure

PhoneBook/
โ”‚โ”€โ”€ Contact.java
โ”‚โ”€โ”€ PhoneBook.java
โ”‚โ”€โ”€ Main.java
โ”‚โ”€โ”€ contacts.dat (auto-generated)

๐Ÿ› ๏ธ Technologies Used

  • Java
  • OOP (Encapsulation, Abstraction, Comparable)
  • Collections Framework (ArrayList, TreeMap)
  • File Handling (Serialization)
  • Regex (for phone validation)

๐Ÿ“ฑ Indian Phone Number Validation

Valid formats:

  • 9876543210
  • 919876543210
  • +919876543210

Invalid numbers are rejected.


โ–ถ๏ธ How to Run

1๏ธโƒฃ Compile

javac *.java

2๏ธโƒฃ Run

java Main

๐Ÿ“ธ Sample Menu

๐Ÿ“ฑ PHONEBOOK MENU
1. Add Contact
2. View All Contacts
3. Group by First Letter
4. Search by Name
5. Search by Phone
6. Mark Favorite
7. Update Contact
8. Delete Contact
9. Exit

๐Ÿ’พ Data Storage

All contacts are saved in:

contacts.dat

So data remains available after restarting the program.