Is there any technical difference between a class which inherits from another class and a class which is a subclass of it? What's the difference between A and B in the following code:
A)
public class foo {
...
private class bar {...}
}
B)
public class foo { ...}
private class bar extends foo {...}
You're mixing terms. A subclass is the same as an inherited class.
In example A, bar
is an inner class. An inner class is like a nested type. bar
can see all the private stuff from foo
but it's not itself a foo
(you can't cast bar
to foo
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With