Here are several high-quality resources for practicing Java Object-Oriented Programming (OOP) concepts:
GeeksforGeeks - Java OOP Exercises
Website: https://www.geeksforgeeks.org/java/java-oop-exercises/
Key Features:
Over 25 practice problems covering core OOP principles: encapsulation, inheritance, polymorphism, abstraction, constructors, method overriding, and interfaces.
Includes solutions with code examples and expected outputs.
Problems range from basic (e.g., creating a
MessagePrinterclass) to intermediate (e.g., designing aRectangleclass with getters/setters and area calculation).
Programiz Pro - Practice: Java OOP
Key Features:
Interactive, hands-on practice with 20+ problems.
Focuses on real-world application: inheritance, method overriding, encapsulation, and abstraction.
Example task: Create an
Animalclass with aneat()method, then inherit aDogclass and calleat().
NTU Singapore - OOP Exercises (Java Programming Tutorial)
Website: https://www3.ntu.edu.sg/home/ehchua/programming/java/J3f_OOPExercises.html
Key Features:
Comprehensive set of exercises with detailed guidance.
Covers class design, constructors,
toString(),equals(), method overloading, and inheritance.Includes test drivers (e.g.,
TestCircle.java) to validate your code.
GitHub - Java OOP Practice Repository
Repository: https://github.com/SadeeshaJayaweera/Java-Practical-Codes-
Key Features:
Real-world project-style practice with code and solutions.
Topics include class constructors, method overloading, inheritance, and interface implementation.
Great for building a portfolio of OOP code.
Scribd - Java OOP Practice Problems
Document: https://www.scribd.com/document/940528857/Java-OOP-Practice-Problems
Key Features:
System-based problems (e.g., library management, student enrollment, hospital appointments).
Includes class definitions, input/output formats, and sample test cases.
Ideal for applying OOP to complex data management tasks.
These resources provide a structured path from foundational OOP concepts to advanced design patterns, helping you build strong, reusable, and maintainable Java code.
Videos
I have noticed that for Java practice problems online that I have seen, it usually makes you solve the problem in one class file where you do everything in main method. In my class assignments, it mirrors real-world set up in that there are multiple classes that interact with each other somehow to make the program work. I'm rusty on how to code such that multiple classes can interact each other like how to set up the class like which methods to have, how to define variables, how to make sure methods/var in one class can be accessed in another, etc. Is there any website that offers good practice for this? If not any you know of, what else could I try?
For me, I notice I usually do something wrong and do not figure it out until it's way too late, so it will help me for me to have a basic idea of what to avoid before I do anything. Aka if it can grade how I implemented things and offer tips
Also for File i/o. specifically
I am looking for a good website which has a lot of inermediate level java OOP real world problems for me to practice. I posted an example below for what type of exercises I am looking for
Implement student's schedule application:
-
A schedule is a list of lectures, each one defined by subject, day-of-week, start & end times
-
Make it possible to create a schedule as described above
-
Make it possible to generate 'schedule in time' for a given period of time, defined by start and end dates. For instance, if lectures are defined like this: Math Mondays 8:00-8:45, Tuesdays 10:00-10:45 Physics Mondays 9:00-9:45 Then a schedule generated for 2016.03.01 (Tue) would contain a single entry, Math
-
Make it possible to answer a question 'What lecture is the student at' for any given point in time. That might be a specific lecture, non-working day, a break between lectures, or a time before or after the lectures. To make it more interesting, account for public holidays, for instance 2016.03.11 would result 'non-working day' even though there might be lectures defined for Friday.
-
Make it impossible to define invalid schedule -- one with lectures overlapping, starting before 8:00 or ending after 18:00