Local Classes
See LocalClasses.java to better understand how local classes work
Local classes: classes that are defined within non-static methods
The Following are characteristics of local classes
1) a local class may behave differently depending on whether it is…