psk_karthik
asked on
interface doubts
is it necessary to load all the method in the interface?what are the default modifire of the interface?
plz mail me psk_karthik@hotmail.com
plz mail me psk_karthik@hotmail.com
ASKER
when we implementing the interface is it possible to load all the methods of the interface ? and also the default access modifier of the interface?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And secondly, DON'T give e-mail IDs in your question-pages. We're supposed to answer your questions here, not on mails. Sometimes, the moderators don't like it if they see e-mail IDs on question-pages.
>>It is not important to implement (provide the code for) all methods defined in the interface - >>but if you do that, then your class has to be declared as abstract.
"if you do that" == "NOT implementing all methods defined in the interface"
>> DON'T give e-mail IDs in your question-pages.
It's begging for spam too.
"if you do that" == "NOT implementing all methods defined in the interface"
>> DON'T give e-mail IDs in your question-pages.
It's begging for spam too.
>> "if you do that" == "NOT implementing all methods defined in the interface"
Yes.
>> It's begging for spam too.
Yes ;-)
Yes.
>> It's begging for spam too.
Yes ;-)
If not clear yet:
say, you have a class Xyz implements Interf
that means that you promise to implement all methods defined in 'Interf' in 'Xyz'
in order to make 'Xyz' "look like an Interf".
If you do not implement all those methods, your class is not going to look like an 'Interf' at all
and unacceptable for all references to 'Interf'.
So, if somewhere there is a variable:
Interf pointer;
JAVA demands that it will always point at a 'Interf' look-alike.
Do you understand that?
;JOOP!
say, you have a class Xyz implements Interf
that means that you promise to implement all methods defined in 'Interf' in 'Xyz'
in order to make 'Xyz' "look like an Interf".
If you do not implement all those methods, your class is not going to look like an 'Interf' at all
and unacceptable for all references to 'Interf'.
So, if somewhere there is a variable:
Interf pointer;
JAVA demands that it will always point at a 'Interf' look-alike.
Do you understand that?
;JOOP!
Please proceed with that recommendation.
Load a method of an interface? How do you do that?
2) Answering questions by e-mail is not how it works here at EE.