| Author |
Is this a valid Interface declaration?
|
Jasper Vader
Ranch Hand
Joined: Jan 10, 2003
Posts: 284
|
|
interface Worker { void perform_work(); } ... i found the above code in a mock exam... i thought that all methods in an interface need to be abstract?
|
giddee up
|
 |
Sridhar Srikanthan
Ranch Hand
Joined: Jan 08, 2003
Posts: 366
|
|
Jasper, all the methods in an interface are implicitly public and abstract. It doesnt matter even if you explicitly state them Similarly, all variables in interfaces are implicitly public, static and final. You might have got confused with abstract classes in which the declaration of abstract methods is explicitly done with the abstract keyword Hope this Helps Sri
|
 |
Jasper Vader
Ranch Hand
Joined: Jan 10, 2003
Posts: 284
|
|
cheers Sri, thanks for the clarification!
|
 |
 |
|
|
subject: Is this a valid Interface declaration?
|
|
|