This repository contains my lab exercises and projects in Java. It covers a wide range of topics, from basic object-oriented programming (OOP) concepts to more advanced topics like exception handling, collections, multithreading, and file I/O. The examples are designed to help understand the fundamentals of Java programming.
- Object-Oriented Programming (OOP): Inheritance, polymorphism, abstraction, and encapsulation.
- Data Structures: Implementation of data structures like lists, queues, stacks, and trees.
- Exception Handling: Handling exceptions and creating custom exception classes.
- Multithreading: Creating and managing threads in Java.
- File I/O: Reading from and writing to files using Java's I/O streams.
Java-Lab/
│
├── OOP_Concepts/ # Exercises and examples related to Object-Oriented Programming
│ ├── inheritance_example.java # Example on inheritance
│ ├── polymorphism_example.java # Example on polymorphism
│ └── encapsulation_example.java # Example on encapsulation
│
├── Data_Structures/ # Implementation of various data structures
│ ├── stack_implementation.java # Stack implementation using arrays
│ ├── queue_implementation.java # Queue implementation
│ └── binary_tree.java # Binary tree implementation
│
├── Exception_Handling/ # Examples on Java exception handling
│ ├── try_catch_example.java # Basic try-catch example
│ ├── custom_exception.java # Example of creating custom exceptions
│ └── exception_propagation.java # Exception propagation example
│
├── Multithreading/ # Multithreading in Java
│ ├── thread_example.java # Basic thread creation
│ └── synchronization.java # Example on thread synchronization
│
└── File_IO/ # File handling examples in Java
├── file_read.java # Reading from a file
└── file_write.java # Writing to a file
-
Clone the repository:
git clone https://github.com/josethomas45/Java-Lab.git
-
Compile and Run the Java Files: Navigate to the folder containing the
.java
files and compile them using thejavac
command:javac filename.java
-
Run the Program: After compiling, you can run the Java program using:
java filename
-
Object-Oriented Programming (OOP):
- Examples demonstrating inheritance, polymorphism, encapsulation, and abstraction.
-
Data Structures:
- Implementation of data structures such as stacks, queues, and binary trees.
- Understanding of basic algorithms like searching and sorting.
-
Exception Handling:
- How to handle exceptions in Java using
try-catch
blocks andfinally
. - Creation of custom exceptions for better error handling.
- How to handle exceptions in Java using
-
Multithreading:
- Basics of creating and running threads in Java.
- Thread synchronization techniques to avoid race conditions.
-
File I/O:
- Reading from and writing to files using Java's input and output streams.
- Java JDK: Ensure you have Java Development Kit (JDK) installed. You can download it from Oracle's official site.
- IDE (Optional): Use any Java IDE like Eclipse, IntelliJ IDEA, or NetBeans for easier code management and execution.
Contributions to improve this repository are always welcome! Here’s how you can contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push the changes to your branch (
git push origin feature-branch
). - Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
For any questions, suggestions, or feedback, feel free to reach out:
Jose Thomas
GitHub Profile