Abstract keyword
Monkey Forums/Monkey Beginners/Abstract keyword
| ||
I am very sorry if it has been asked before, but i have not found it anywhere. The question is: How do abstract methods in interfaces, and abstract classes work? I have a little knowledge about how they work in Java but I have not programmed in a while and, trying to do so again, i have had many problems making it work in xmonkey. Thank you to everyone. Sincerelly, Sullivan. |
| ||
An abstract class is a class with one or more abstract methods. You can't instantiate such a class, only extended classes that implement all the abstract methods, An interface has only abstract methods, so you don't need the Abstract keyword when declaring them. A class can only extend one class, but it can implement as many interfaces as it wants. It's quite similar to Java, really. |
| ||
Thank you very much. |