Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

interface doubts

Posted on 2004-03-30
10
Medium Priority
?
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

688 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