Closed GlendaChong closed 9 months ago
Question stated that "the Goo interface doesn't have any default method implementation", for Bar to be a concrete class it has to provide an implementation for store().
On the other hand the process() method is not italicized and there is no {abstract} keyword. Hence it is not an abstract method and has a default implementation in the abstract class Foo.
I think Java allows definition of abstract classes without any abstract methods https://stackoverflow.com/questions/4811678/defining-an-abstract-class-without-any-abstract-methods
Question stated that "the Goo interface doesn't have any default method implementation", for Bar to be a concrete class it has to provide an implementation for store().
On the other hand the process() method is not italicized and there is no {abstract} keyword. Hence it is not an abstract method and has a default implementation in the abstract class Foo.
I think Java allows definition of abstract classes without any abstract methods https://stackoverflow.com/questions/4811678/defining-an-abstract-class-without-any-abstract-methods
@GlendaChong this answer given by @TeeRenJing is correct.
Thank you!
Hello, may I know what's the reasoning behind why the options 2 and 3 are correct?
My understanding is that removing the store() method will cause a compile error because Bar is not an abstract class, which makes the option correct.
However, by the same logic, will removing process() method not also cause a compile error?
Could someone help to clarify any misunderstandings I have, as well as to provide an explanation for the 2 options?
Thank you!