Inner classes Tutorial Java 1. What is inner class in Java? Explain with example? 2. What is nested class in Java? Explain clearly? A class declared within another class is known as inner class or nested class.
public class Demo // outer class
class Test // inner class or nested class
In the above code, Demo is known as outer class and Test…