Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

interface doubts

Posted on 2004-03-30
10
Medium Priority
?
242 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 400 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

886 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