An inner class is a class that is nested or defined within another class. On the other hand, a subclass is a class that is derived from another class. Moreover, while an inner class can only be accessed by using the reference of the outer class within which it is nested, a subclass can be accessed directly unless the subclass has inherited private variables.