josethomas45 / Java-Lab

S3 Java lab-works from object oriented programming lab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Java Lab

Overview

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.

Key Topics:

  • 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.

Folder Structure

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

Getting Started

  1. Clone the repository:

    git clone https://github.com/josethomas45/Java-Lab.git
  2. Compile and Run the Java Files: Navigate to the folder containing the .java files and compile them using the javac command:

    javac filename.java
  3. Run the Program: After compiling, you can run the Java program using:

    java filename

Key Topics Covered

  1. Object-Oriented Programming (OOP):

    • Examples demonstrating inheritance, polymorphism, encapsulation, and abstraction.
  2. Data Structures:

    • Implementation of data structures such as stacks, queues, and binary trees.
    • Understanding of basic algorithms like searching and sorting.
  3. Exception Handling:

    • How to handle exceptions in Java using try-catch blocks and finally.
    • Creation of custom exceptions for better error handling.
  4. Multithreading:

    • Basics of creating and running threads in Java.
    • Thread synchronization techniques to avoid race conditions.
  5. File I/O:

    • Reading from and writing to files using Java's input and output streams.

Requirements

  • 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.

How to Contribute

Contributions to improve this repository are always welcome! Here’s how you can contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes and commit them (git commit -m 'Add new feature').
  4. Push the changes to your branch (git push origin feature-branch).
  5. Create a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.


Contact

For any questions, suggestions, or feedback, feel free to reach out:

Jose Thomas
GitHub Profile

About

S3 Java lab-works from object oriented programming lab


Languages

Language:Java 100.0%