Joanne Neal wrote:
Mike Okri wrote:If a nested Subclass extends a Superclass with a private constructor, Subclass cannot be instantiated outside Superclass.
It might be possible with reflection and the setAccessible method.
James Boswell wrote:Mike
In the example you have given, how would you create an instance of Subclass outside of Superclass? You would need an instance of Superclass first which you cannot achieve (as it has no public constructor).
I Wayan Saryada wrote:The answer is you can't extend the Parent class if it has a private default constructor.
sharma ishu wrote:Why is s not null as no argument has been passed to it.
sharma ishu wrote:
This is my question. If static methods can't be inherited, then why is this illegal?
sharma ishu wrote:
But since static methods are not overridden so this is just a redefinition in another class. Isn't it?
Tim Holloway wrote:I don't know how much "out of the box" this is.
Tim Holloway wrote:As a measure of programming aptitude it fails, because one of the first things you want to do when solving a problem is to obtain as much data as possible. But this puzzle is predicated on the absence of something, not its presence.
To reference Sherlock Holmes: The dog didn't bark.
vipul bondugula wrote:There is no need to synchronize removeFirst(). As the list itself is synchronized..
Jeff Verdegan wrote:Were they introduced in some other corner of the Java universe prior to that?