So, if the question is: “Is it good practice to create an inner class for simple functionality, when it could have been solved in a simpler way” then the answer is NO .
Read moreWhat are the advantages and disadvantages of inner classes?
Inner classes are used to develop a more readable and maintainable code because they logically group classes and interfaces in one place . Easy access, as the inner object, is implicitly available inside an outer Code optimization requires less code to write. It can avoid having a separate class.
Read more