Jarpository is a collection of Java programs aimed at assisting students of KTU (Kerala Technological University) in their learning of Java programming. This repository contains pre-tested, functional Java programs that cover various concepts, making it a valuable resource for assignments, projects, and exams.
- Tested Programs: All programs within this repository are rigorously tested to ensure their correctness.
- Diverse Collection: The repository encompasses a wide array of Java programs that are commonly encountered in the KTU university curriculum.
- Readable and Clear: Each program is well-documented and organized, enhancing its comprehensibility for learners.
Navigating through the repository is made easy through thoughtful organization.
The directory structure of Jarpository follows a clear hierarchy. Here is an outline of this structure, arranged from the most to the least significant level:
| Priority Level | Concept |
|---|---|
| 1 | Files |
| 2 | Exception Handling |
| 3 | OOP+ (Abstraction, Encapsulation, Inheritance, Polymorphism) |
| 4 | OOP basics: Classes, Objects and methods |
| 5 | Strings |
| 6 | Arrays |
| 7 | Functions |
| 8 | Loops and Conditional Statements |
| 9 | Flow Control (switch, if, else, etc.) |
| 10 | Miscellaneous Concepts |
Each priority level corresponds to a dedicated directory or folder. Certain levels may have subdirectories to represent closely related concepts.
Suppose you're searching for a Java program that covers:
a) Inheritance, b) Polymorphism, and c) Exception Handling.
In this case, you can efficiently navigate the repository's structure as follows:
-
Inheritance: Begin by exploring the inheritance directory as it has higher priority.
-
Polymorphism: After reviewing inheritance, proceed to the polymorphism directory.
-
Exception Handling: Finally, navigate to the exception_handling directory that contains programs related to exception handling.
Following this path will lead you to: Inheritance > Polymorphism > ExceptionProgram.java
To make use of the programs within this repository, you should have a Java Development Kit (JDK) installed on your system. Follow these steps to get started:
-
Clone this repository to your local machine:
git clone https://github.com/sahil-shefeek/jarpository.git
-
Navigate to the repository's directory:
cd jarpository -
Compile and run any program using the Java compiler. For instance, to compile and run the program named
Program.java, use these commands:javac Program.java java Program
Each program is stored in a separate file with a descriptive name. To use a specific program:
-
Open the program file (e.g.,
Program.java) with a text editor. -
Study the comments and code to grasp the program's purpose and functionality.
-
Modify the code if necessary or use it as a reference for your projects.
-
Save your changes and follow the setup instructions above to compile and run the program.
When you run cleaner.sh from within the "jarpository" directory, it will scan for and list any .class files within the project directory and its subdirectories, giving you the option to delete them.
-
Open a terminal and navigate to the project's root directory.
-
Ensure the script has executable permissions. If it doesn't, grant them by running:
chmod +x cleaner.sh
-
Run the script by entering the following command:
./cleaner.sh
-
The script will scan your project directory and list any Java bytecode (.class) files it finds, including those in subdirectories. You will be prompted with the following message:
Do you want to delete the listed .class files? (yes/no):Enter "yes" (or any variation) to confirm and delete the listed .class files. Alternatively, enter "no" to cancel the deletion.
The script will proceed to delete the selected .class files if you confirm.
Contributions to Jarpository are encouraged and welcome! If you're interested in contributing, follow these steps:
-
Fork the repository to your GitHub account.
-
Create a new branch for the feature or bug you intend to work on.
-
Implement and test your changes thoroughly.
-
Commit your changes with a descriptive commit message.
-
Push your branch to your forked repository.
-
Open a pull request in the main repository, detailing the changes you've made.