Object-oriented programming (OOP) is a fundamental concept in software development that allows developers to create reusable, maintainable, and scalable code. Java, a popular programming language, supports OOP principles, enabling developers to design and…