Question: JAVA! Refer to the above example of Inner Class, create, compile and run a Java program that calculates the average, minimum and maximum age of
JAVA!
- Refer to the above example of Inner Class, create, compile and run a Java program that calculates the average, minimum and maximum age of your friends and family members. The program should include nested class/inner class, appropriate variables, types and methods.

// Use an inner class. class Outer { int nums [] ; Outer(int n[]) { nums = n; } void analyze () { Inner inob = new Inner(); 11 11 System.out.println("Minimum: System.out.println("Maximum: System.out.println("Average: + inob.min()); + inob.max()); + inob.avg()); 11 } // This is an inner class. class Inner { An inner class int min() { int m = nums [0]; for(int i=1; i m) m = nums (i); return m; } int avg() { int a = 0; for(int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
