0% found this document useful (0 votes)
4 views

java contact

java program

Uploaded by

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

java contact

java program

Uploaded by

yadav1258ji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

MADHAV INSTITUTE OF TECHNOLOGY & SCIENCE, GWALIOR

(Deemed University)
NAAC Accredited with A++
Grade

Skill Based Mini Project Report

On

“Contact Management Application”

Submitted By:
Aryan Yadav (0901CS231025)
Ayush Arya (0901CS231027)

Submitted to:
Prof. Kratika Sharma
Assistant Professor

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING


MADHAV INSTITUTE OF TECHNOLOGY & SCIENCE
GWALIOR - 474005 (MP) est. 1957

Jan-June 2025
MADHAV INSTITUTE OF TECHNOLOGY & SCIENCE, GWALIOR
(Deemed to be University)
NAAC Accredited with A++ Grade

CERTIFICATE

This is certified that Aryan Yadav (0901CS231025) have submitted the project report titled
“Contact Management Application” under the mentorship of Prof. Kratika Sharma, in
partial fulfilment of the requirement for the award of degree of Bachelor of Technology in
Computer Science & Engineering from Madhav Institute of Technology and Science,
Gwalior.

Prof. Kratika Sharma


Faculty Mentor
Computer Science and Engineering
MADHAV INSTITUTE OF TECHNOLOGY & SCIENCE, GWALIOR
(Deemed to be University)
NAAC Accredited with A++ Grade

CERTIFICATE

This is certified that Ayush Arya (0901CS231027) have submitted the project report titled
“Contact Management Application” under the mentorship of Prof. Kratika Sharma, in
partial fulfilment of the requirement for the award of degree of Bachelor of Technology in
Computer Science & Engineering from Madhav Institute of Technology and Science,
Gwalior.

Prof. Kratika Sharma


Faculty Mentor
Computer Science and Engineering
MADHAV INSTITUTE OF TECHNOLOGY & SCIENCE, GWALIOR
(Deemed to be University)
NAAC Accredited with A++ Grade

DECLARATION

I hereby declare that the work being presented in this project report, for the partial fulfilment
of requirement for the award of the degree of Bachelor of Technology in Computer Science
& Engineering at Madhav Institute of Technology & Science, Gwalior is an authenticated and
original record of my work under the mentorship of Prof. Kritika Sharma , Computer
Science & Engineering.
I declare that I have not submitted the matter embodied in this report for the award of any
degree or diploma anywhere else.

Aryan Yadav (0901CS231025)


2nd Year
Computer Science & Engineering
MADHAV INSTITUTE OF TECHNOLOGY & SCIENCE, GWALIOR
(Deemed to be University)
NAAC Accredited with A++ Grade

DECLARATION

I hereby declare that the work being presented in this project report, for the partial fulfilment
of requirement for the award of the degree of Bachelor of Technology in Computer Science
& Engineering at Madhav Institute of Technology & Science, Gwalior is an authenticated and
original record of my work under the mentorship of Prof. Kritika Sharma , Computer
Science & Engineering.
I declare that I have not submitted the matter embodied in this report for the award of any
degree or diploma anywhere else.

Ayush Arya (0901CS231027)


2nd Year
Computer Science & Engineering
MADHAV INSTITUTE OF TECHNOLOGY & SCIENCE, GWALIOR
(Deemed to be University)
NAAC Accredited with A++ Grade

ACKNOWLEDGEMENT

The full semester project has proved to be pivotal to my career. I am thankful to my institute, Madhav
Institute of Technology and Science to allow me to continue my disciplinary/interdisciplinary
project as a curriculum requirement, under the provisions of the Flexible Curriculum Scheme (based
on the AICTE Model Curriculum 2018), approved by the Academic Council of the institute. I extend
my gratitude to the Director of the institute, Dr. R. K. Pandit and Dean Academics, Dr. Manjaree
Pandit for this.
I would sincerely like to thank my department, Department of Computer Science & Engineering,
for allowing me to explore this project. I humbly thank Dr. Manish Dixit, Head, Department of
Computer Science & Engineering, for his continued support during the course of this engagement,
which eased the process and formalities involved.
I am sincerely thankful to my faculty mentors. I am grateful to the guidance of Prof. Kritika Sharma
, Computer Science and Engineering, for her continued support and guidance throughout the
project. I am also very thankful to the faculty and staff of the department.

Aryan Yadav (0901CS231025)


2nd Year
Computer Science & Engineering
MADHAV INSTITUTE OF TECHNOLOGY & SCIENCE, GWALIOR
(Deemed to be University)
NAAC Accredited with A++ Grade

ACKNOWLEDGEMENT

The full semester project has proved to be pivotal to my career. I am thankful to my institute, Madhav
Institute of Technology and Science to allow me to continue my disciplinary/interdisciplinary
project as a curriculum requirement, under the provisions of the Flexible Curriculum Scheme (based
on the AICTE Model Curriculum 2018), approved by the Academic Council of the institute. I extend
my gratitude to the Director of the institute, Dr. R. K. Pandit and Dean Academics, Dr. Manjaree
Pandit for this.
I would sincerely like to thank my department, Department of Computer Science & Engineering,
for allowing me to explore this project. I humbly thank Dr. Manish Dixit, Head, Department of
Computer Science & Engineering, for his continued support during the course of this engagement,
which eased the process and formalities involved.
I am sincerely thankful to my faculty mentors. I am grateful to the guidance of Prof. Kritika Sharma
, Computer Science and Engineering, for her continued support and guidance throughout the
project. I am also very thankful to the faculty and staff of the department.

Ayush Arya (0901CS231027)


2nd Year
Computer Science & Engineering
CONTENTS

Sr. No. Content Page No.


1. Declaration 4-5

2. Acknowledgment 6-7

4. Abstract 10

5. Introduction 11

6. Implementation 12-16

8. Conclusion 17
MINI PROJECT
ABSTRACT

The Contact Management System is a Java-based console application designed to facilitate seamless
storage, retrieval, and management of contact details. The system provides a menu-driven interface,
allowing users to add new contacts, search for specific contacts by name, and display all stored
contacts in an organized manner. By utilizing object-oriented programming (OOP) principles, such as
encapsulation and modular design, the system ensures efficient data handling and streamlined
interactions.

The project is implemented using Java Collections Framework, specifically ArrayList, to store contact
objects dynamically. The ContactManager class serves as the core controller, managing user input
and executing different functionalities, while the Contact class defines the structure of individual
contact records. The system is designed to be interactive and user-friendly, prompting users with
clear options and ensuring smooth operation through an error-handling mechanism.

A key feature of the application is its ability to validate user input and prevent common errors. For
example, if a user enters an invalid selection in the menu or provides incorrect input formats, the
program gracefully handles these exceptions instead of terminating abruptly. Additionally, the
system maintains flexibility for future enhancements, such as integrating database storage, GUI-
based interfaces, or cloud-based synchronization.

This project offers valuable insights into Java programming, object-oriented design, user input
handling, exception management, and console-based application development. It serves as an
educational tool, helping learners understand real-world software implementation while reinforcing
fundamental programming concepts. With its structured and scalable architecture, this Contact
Management System can evolve into a more advanced contact-handling solution, making it highly
relevant in the domain of software development and practical applications.
INTRODUCTION

Communication plays a vital role in today's interconnected digital landscape, making efficient
messaging systems essential for seamless interaction. The Contact Management System is a Java-
based console application that enables users to store, manage, and retrieve contact details
effortlessly. With an intuitive interface, this system facilitates fundamental operations such as adding
contacts, searching for contacts by name, and displaying all saved contacts, ensuring users can
access information with ease.

The system is implemented using object-oriented programming (OOP) principles, which provide
structure and modularity to the application. At its core, the system consists of two main
components:
1. The Contact Class, which defines individual contact records, including essential details such
as name and phone number.
2. The ContactManager Class, which acts as the central controller, handling user interactions,
managing stored contacts, and ensuring smooth program execution.
This project leverages the Java Collections Framework, particularly the ArrayList, to dynamically
manage contacts. A menu-driven console guides users through the available options, allowing for
simple and efficient navigation. Furthermore, exception handling mechanisms prevent system
crashes due to invalid inputs, enhancing the overall reliability of the application.

By implementing this system, students and developers gain hands-on experience in core Java
programming concepts, including data structures, user input processing, exception handling, and
interactive system design. The project also highlights the importance of efficient data management,
making it a valuable learning resource for understanding practical applications of programming in
real-world scenarios. Future enhancements such as database integration, graphical interfaces
(GUIs), and cloud-based storage could further improve its usability and scalability, transforming it
into a fully functional contact management solution.
IMPLEMENTATION

The implementation of the Contact Management System involves developing a Java-based console
application that allows users to manage their contacts. The system is designed using object
oriented principles, ensuring modularity and easy scalability.

1. Data Model – Contact Class


 The Contact class defines the structure of each contact, including name and phone number.
 The class provides getter methods for retrieving contact information and an overridden
toString method for better readability.

2. Core Functionality – ContactManager Class


 Adding Contacts: Users can enter a name and phone number, and the system stores the
contact in an ArrayList.
 Searching Contacts: The system allows users to search for a contact by name, displaying
the contact details if found.
 Displaying All Contacts: Users can list all saved contacts, ensuring quick access to stored
data.
 Input Validation: The program includes error handling to prevent incorrect inputs, ensuring
seamless execution.

User Interaction – Menu-driven System


 The application presents a menu where users can select options to add, search, display, or
exit.
 A while-loop ensures continuous interaction until the user decides to exit the program.
 Exception handling prevents crashes due to invalid inputs, improving user experience.

CODE:-

import java.util.ArrayList;

import java.util.Scanner;

public class ContactManager {

static class Contact {

private String name;

private String phoneNumber;

public Contact(String name, String phoneNumber) {

this.name = name;
IMPLEMENTATION

this.phoneNumber = phoneNumber;

public String getName() {

return name;

public String getPhoneNumber() {

return phoneNumber;

@Override

public String toString() {

return "Name: " + name + ", Phone: " + phoneNumber;

private ArrayList<Contact> contacts = new ArrayList<>();

private Scanner scanner = new Scanner(System.in);

public void addContact() {

System.out.print("Enter name: ");

String name = scanner.nextLine();

System.out.print("Enter phone number: ");

String phoneNumber = scanner.nextLine();

contacts.add(new Contact(name, phoneNumber));

System.out.println("Contact added successfully!");

}
IMPLEMENTATION

public void searchContact() {

System.out.print("Enter name to search: ");

String name = scanner.nextLine();

for (Contact contact : contacts) {

if (contact.getName().equalsIgnoreCase(name)) {

System.out.println(contact);

return;

System.out.println("Contact not found!");

public void displayContacts() {

if (contacts.isEmpty()) {

System.out.println("No contacts available.");

return;

for (Contact contact : contacts) {

System.out.println(contact);

public void start() {


IMPLEMENTATION

while (true) {

System.out.println("\nContact Management System");

System.out.println("1. Add Contact");

System.out.println("2. Search Contact");

System.out.println("3. Display All Contacts");

System.out.println("4. Exit");

System.out.print("Choose an option: ")

try {

int choice = Integer.parseInt(scanner.nextLine());

switch (choice) {

case 1:

addContact();

break;

case 2:

searchContact();

break;

case 3:

displayContacts();

break;

case 4:

System.out.println("Exiting program.");

return;

default:

System.out.println("Invalid option. Please try again.");


IMPLEMENTATION

} catch (NumberFormatException e) {

System.out.println("Invalid input. Please enter a number.");

public static void main(String[] args) {

ContactManager manager = new ContactManager();

manager.start();

}
CONCLUSION

The Contact Management System effectively demonstrates key concepts in Java programming, data
management, and user interaction. By utilizing object-oriented principles, such as encapsulation
and modular design, the system ensures structured storage and retrieval of contact details. The
application features a menu-driven interface, allowing users to efficiently add, search, and display
contacts while leveraging ArrayList for dynamic data management. Exception handling mechanisms
play a crucial role in maintaining the reliability of the system by preventing crashes due to incorrect
inputs, ensuring a seamless user experience.

Beyond its current capabilities, the system provides a strong foundation for future enhancements.
Potential improvements include database integration for persistent storage, graphical user
interfaces (GUIs) for better accessibility, and cloud synchronization for multi-device support.
Adding functionalities such as sorting, filtering, and advanced search options would further improve
usability. These advancements can transform the Contact Management System into a real-world
application, expanding its relevance beyond a console-based implementation.

Overall, this project highlights the practical applications of programming and software
development while reinforcing fundamental Java concepts. It serves as an excellent educational tool
for students, enabling hands-on learning in data structures, user input processing, and interactive
system design. The structured approach ensures scalability and maintainability, making the Contact
Management System a stepping stone toward more complex application development.

You might also like