nus-cs2103-AY2021S2 / forum

10 stars 0 forks source link

A question about Practice Exam question. #345

Closed skinnychenpi closed 3 years ago

skinnychenpi commented 3 years ago

image Hi, may I ask why Moo has to be declared as abstract class? I thought that only Foo is abstract. Any clarification on this?

ong6 commented 3 years ago

Moo has to be declared as an abstract class?

I think you may have a typo in your question? Were you trying to ask why the code causes a compile error instead?

tlylt commented 3 years ago

If Moo is not declared as abstract class, then it has to implement the store method from the Goo interface. Hope this clarifies:)

skinnychenpi commented 3 years ago

If Moo is not declared as abstract class, then it has to implement the store method from the Goo interface. Hope this clarifies:)

Ahh thanks for the reply. I see what's going on here.