The Java programming language is a simple, modern, general-purpose, object-oriented programming language. Having a basic familiarity with the programming language used on the job is a prerequisite for quickly getting up to speed.
The process of restructuring existing computer code without changing its external behavior. It is essential for keeping code readable and maintainable.
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
This is a part of latest question addition to our question library.
Refactor the AlertService and MapAlertDAO classes:
- Create a new package-private interface, named AlertDAO, that contains the same methods as MapAlertDAO.
- MapAlertDAO should implement the AlertDAO interface.
- AlertService should have a constructor that accepts AlertDAO.
- The raiseAlert and getAlertTime methods should use the object passed through the constructor.
- MapAlertDAO implements AlertDAO interface: Wrong answer
- AlertService accepts AlertDAO in its constructor: Wrong answer
- The raiseAlert and getAlertTime methods use AlertDAO passed through constructor: Wrong answer