# Welcome to the Java Practice Tasks Repository
This repository contains practice tasks covering fundamental Java concepts:
- **Loops**
- **Strings**
- **Arrays**
- **Classes & Objects**
- **Inheritance**
- **Polymorphism**
- **Abstraction**
- **Encapsulation**
Each task is located in the `tasks/` folder as a separate Java file. Follow the instructions below to get started with Git, branch creation, and completing the tasks.
---
## 1. Cloning the Repository
1. Make sure you have [Git](https://git-scm.com/downloads) installed.
2. Open your terminal (or command prompt).
3. Navigate to the directory where you want to store the project.
4. Run the following command to clone the repository:
```bash
git clone https://github.com/AH82021/java-practice-tasks.git-
Change into the cloned repository directory:
cd java-practice-tasks
-
Make sure you are on the
mainbranch (usegit statusorgit branch). -
Create a new branch (use a descriptive name, e.g.
feature/john-doe-tasksorsolution/task1):git checkout -b feature/john-doe-tasks
This command creates a new branch and switches you to it immediately.
-
Open the
tasks/folder in your favorite IDE or text editor. -
Complete one of the tasks by editing the corresponding Java file (e.g.,
Task1_Loops.java). -
Return to your terminal and check what changed:
git status
-
Add the changed files to staging:
git add tasks/Task1_Loops.java
(Or
git add .to add all changed files.) -
Commit your changes with a descriptive message:
git commit -m "Implement loop solutions in Task1_Loops.java"
-
Push the branch to the remote repository:
git push origin feature/john-doe-tasks
-
If this is the first time you’re pushing this branch, Git may ask you to set the upstream:
git push --set-upstream origin feature/john-doe-tasks
- Go to the repository on GitHub.
- You should see a prompt saying “Compare & pull request” for your branch. Click it.
- Add a meaningful title and description.
- Submit the pull request.
- Wait for the repository owner or the instructor to review and merge your changes.
Note: Because of branch protection, you cannot push directly to
main. If you attempt to push tomain, you will receive an error. Always work in your own branch and then open a pull request to merge your work.