Forums Register Login

Is this inheritance?

+Pie Number of slices to send: Send
I was hoping someone could set me straight on this inheritance / abstract class question. (Courtesy of Bruce Eckels Thinking in Java, again).

I have a private abstract static class Tester as an inner class in my ListPerformance class. As another variable, I have an array of Tester objects which receieve new anonymous classes as parameters.

Since you cannot instantiate an abstract class, when I say new Tester() and implement the abstract method test() in these anonymous classes, does that mean I am extending the Tester class without using the keyword extends?

Thoughts appreciated.

+Pie Number of slices to send: Send
Yes.
+Pie Number of slices to send: Send
So would it be correct to say: Each of the anonymous classes in the array is a subclass of the abstract Tester class, but since they are anonymous they don't need an explicit name or the keyword extends?
+Pie Number of slices to send: Send
Yes again...
Those cherries would go best on cherry cheesecake. Don't put those cherries on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1081 times.
Similar Threads
Hashtable vs Hashmap
Casting or toString()?
Needs Explanation
Basic Round Up question
increment ???
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:01:13.