Interface in Java

Status
You're currently viewing only R2P2's posts. Click here to go back to viewing the entire thread.
Not open for further replies.

R2P2

Ars Praefectus
3,783
Subscriptor
English isn't your first language, is it?

Anyway, from what I can make out from your description, your Java classes are something like this:

interface A
interface B extends A
Professor implements B
class C extends ? implements ?

If that's the case, then B inherits the methods defined by A, and Professor is required to implement all of those. So Professor *must* implement getName(), getAddress() and getSalary().

If C doesn't implement A or B, or extend Professor, then it can define its methods anyway it likes. ie. It can make getAddress() have a different return type then A says it should, because they are completely unrelated.
 
Status
You're currently viewing only R2P2's posts. Click here to go back to viewing the entire thread.
Not open for further replies.