public class Base { private static final int ID = 3; private String name = "Henry"; public void methodA( final int nn ) { int serialN = 11; class inner { void showResult() { System.out.println( "ID = " + ID ); } } new inner().showResult(); } public static void main (String[] args) {
} }
After the program compiles with no errors, print a copy of it, then make the following changes to it:
1. Modify the main method so that it calls methodA to display the output. Print the new code.
2. Add another inner class to methodA with a method to display the values of the name and nn variables. Be sure methodA invokes this new method, then run the program to display all the output. Print the new code.
3. Create another program that does the same thing as this one, and that also has separate main, methodA, and showResult methods but that doesn't use nested classes.
I need some help with this one. can anyone assist?? thanks ahead of time.