Solved

interface doubts

Posted on 2004-03-30
10
205 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:psk_karthik
10 Comments
 
LVL 37

Expert Comment

by:zzynx
ID: 10713199
1) Completely unclear what you mean
    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.
0
 

Author Comment

by:psk_karthik
ID: 10713247
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?
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 100 total points
ID: 10713286
I don't understand what you mean by 'load', but I will try to answer whatever I have understood from your question:

1. 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.

2. All methods that you implement (which were declared in the interface) must be given the 'public' modifier in the implementing class.

Mayank.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 30

Expert Comment

by:Mayank S
ID: 10713301
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.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10713349
>>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.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 10713406
>> "if you do that" == "NOT implementing all methods defined in the interface"

Yes.

>> It's begging for spam too.

Yes ;-)
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 10713686
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!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 10876662
Please proceed with that recommendation.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question