This repository is a continuation of my Java learning journey, building upon the foundations of Java101.
Here, I explore advanced concepts such as:
- Object-Oriented Programming (OOP) in depth
- Collections Framework
- Algorithms and problem solving
- More complex, real-world inspired projects
Each project is organized under its own package with descriptive names (e.g., Project01XYZ, Project02ABC).
This project demonstrates the Encapsulation principle in Java — one of the four main pillars of Object-Oriented Programming (OOP).
Encapsulation means hiding internal data and allowing access only through controlled methods (getters and setters).
It helps maintain data integrity and prevents external code from modifying object state directly.
- Private Fields:
String nameint pageNumber
- Constructor:
- Initializes the book with given name and page count.
- If the
pageNumberis negative, it automatically resets to0.
- Getter & Setter Methods:
getName()→ Returns the book name.setName(String name)→ Updates the book name.getPageNumber()→ Returns the page number.setPageNumber(int pageNumber)→ Ensures page number cannot be negative.
- Creates a
Bookobject and tests the getter/setter methods. - Demonstrates validation behavior by attempting to set a negative page number.
This project demonstrates the core relationships in Object-Oriented Programming (OOP):
Dependency, Composition, and the foundation for Inheritance.
These concepts are represented through a simple academic system with Student, Instructor, and Course classes.
Represents a student with:
name,surname,idNo,address, andnotefields.- Encapsulation through getters and setters.
- Validation in
setNote()to ensure the grade is between 0–100.
Represents an instructor with:
name,surname, anddepartment.- Standard getter and setter methods for encapsulation.
- Demonstrates Composition → Each
Coursehas anInstructor. - Demonstrates Dependency → The method
calcAverage(Student[] students)depends onStudentobjects to function. - Contains:
calcAverage()→ Calculates average grade of enrolled students.- Accessor methods for both course and instructor details.
- Creates and connects
Student,Instructor, andCourseobjects. - Prints instructor’s department.
- Optionally (commented line) shows how to calculate students’ average grades using dependency logic.
This mini Java project models a university organization based on a UML diagram.
It demonstrates Abstraction, Inheritance, and a bit of Polymorphism.
Employee(abstract)AcademicianLecturer(senate meeting, exam)Assistant(quiz)LabAssistant(enter lab, teach lab)
OfficerInformationTechnology(setup network)SecurityOfficer(stand watch)
A text-based adventure game built entirely with Java, where players explore mysterious locations, fight dangerous enemies, and collect rewards to survive on a dark and foggy island.
- 🌍 Exploration System — Travel between multiple areas like Safe House, Cave, Forest, and River.
- ⚔️ Combat Mechanics — Engage in turn-based battles against Zombies, Vampires, and Bears.
- 🧍 Player Customization — Choose your character class: Samurai, Archer, or Knight.
- 🛒 Tool Store — Purchase weapons and armors to boost your attack and defense.
- 💾 Inventory System — Keep track of your items, coins, and equipped gear.
- 🧱 Clean UI — Fully English terminal interface with structured layouts and icons.
- Run the
Gameclass to start the adventure. - Enter your player name.
- Choose your character (Samurai, Archer, or Knight).
- Explore areas and decide whether to fight or retreat.
- Collect rewards, visit the Tool Store to upgrade, and survive as long as you can!
- Language: Java
- IDE: IntelliJ IDEA
- Concepts: Object-Oriented Programming (OOP), Inheritance, Polymorphism, Abstraction
- Structure: Clean modular classes for Player, Location, Obstacle, Weapon, and more.
This project demonstrates the four main types of nested classes in Java, each implemented with clear examples and clean console outputs.
- Inner Class (Non-Static) → Demonstrates how inner classes can access outer class members.
- Static Inner Class → Shows how to access members without creating an outer class instance.
- Local Inner Class → Defines a class inside a method and accesses its local scope.
- Anonymous Inner Class → Implements an abstract method on the fly without naming the subclass.
- Code organization and encapsulation with nested classes.
- Scope and access control between outer and inner classes.
- Static vs. non-static context understanding in Java.
Simply execute the Main.java file.
Each nested class example will display in the terminal with a clean and structured output format.
This project demonstrates Java Generics with real-world examples.
It includes reusable utility classes for handling different data types safely and efficiently.
- Clone the repository:
git clone https://github.com/kullaniciAdiniz/java102.git