[Solved] Relation between class A and class B


It’s just an nested class i.e. class within class. It’s similar to you defining field and passing value like say private String mystr = new String(str); So here you can access private field str and pass it onto String.

Similarly you have defined non static class within the outer class which would access private/protected/public field defined in outer class.

You call a class as derived, if say it extends another class. Something like:

public class MyParentClass {}
public class MySubClass extends MyParentClass {}

solved Relation between class A and class B