Curriculum
Simple File-Based Contact Book Project in Java is a practical mini project used to manage contact information using file handling concepts. This project helps students understand how Java applications store and retrieve data permanently using files.
In this Core Java course in Jaipur, students will learn how to build a Simple File-Based Contact Book Project in Java using file handling, classes, objects, ArrayList, FileWriter, FileReader, BufferedReader, and Object-Oriented Programming concepts.
File-based contact management systems are widely used in:
Understanding Simple File-Based Contact Book Project in Java helps students gain practical software development experience and improve file handling skills.
Contact Book Project is:
used to:
This project helps students:
Main features:
This project uses:
The:
Contact
class stores contact details.
class Contact {
String name;
String phone;
Contact(String name, String phone) {
this.name = name;
this.phone = phone;
}
void display() {
System.out.println(
name + " " + phone);
}
}
The Contact class contains:
FileWriter writer =
new FileWriter("contacts.txt");
writer.write(
"Rahul 9876543210");
File handling helps applications:
import java.io.FileWriter;
import java.io.IOException;
class SaveContacts {
public static void main(String[] args) {
try {
FileWriter writer =
new FileWriter("contacts.txt");
writer.write(
"Rahul 9876543210\n");
writer.write(
"Aman 9988776655");
writer.close();
System.out.println(
"Contacts Saved");
} catch(IOException e) {
System.out.println(
"File Error");
}
}
}
Contacts Saved
BufferedReader reads contact records efficiently.
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
class ReadContacts {
public static void main(String[] args) {
try {
BufferedReader reader =
new BufferedReader(
new FileReader("contacts.txt"));
String line;
while((line =
reader.readLine()) != null) {
System.out.println(line);
}
reader.close();
} catch(IOException e) {
System.out.println(
"File Error");
}
}
}
Rahul 9876543210
Aman 9988776655
import java.io.FileWriter;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
class ContactBook {
public static void main(String[] args) {
try {
FileWriter writer =
new FileWriter("contacts.txt");
writer.write(
"Rahul 9876543210\n");
writer.write(
"Aman 9988776655");
writer.close();
BufferedReader reader =
new BufferedReader(
new FileReader("contacts.txt"));
String line;
System.out.println(
"Saved Contacts");
while((line =
reader.readLine()) != null) {
System.out.println(line);
}
reader.close();
} catch(IOException e) {
System.out.println(
"File Error");
}
}
}
Saved Contacts
Rahul 9876543210
Aman 9988776655
This project uses:
Managing:
Handling:
Managing:
Storing:
This project provides:
This may cause:
Wrong path may cause:
FileNotFoundException
File operations require:
Students can add:
File-based projects help students:
In this lesson, students learned:
These concepts are essential for Java programming, backend development, and enterprise software systems.
It is a Java application used to store and manage contact information.
File handling stores contact data permanently.
The project uses file handling, classes, objects, BufferedReader, and exception handling.
BufferedReader efficiently reads file data line by line.
Closing files prevents memory leaks and resource locking.
They are used in mobile apps, CRM systems, enterprise software, and customer management systems.
WhatsApp us