Question:
Can i expand an interface?
Answer:
I didn't understand ur question properly. My understanding is by expand you mean extend. If I am right, you can extend interfaces in java. It's same as extending classes in Java. Source: CoolInterview.com
Yes, we can extends our interfaces by other interfaces only. the implementation class of our interface(if it is non-abstract class)should implement all methods which are declared in both interfaces Source: CoolInterview.com
Answered by: sanjeeva | Date:
| Contact sanjeeva
Hi, YES. We can extend interfaces as classes.See the below program.
public interface Itest1 { public void display(); } public interface Itest2 { public void getData(); }
public Itest1 extends Itest2 Source: CoolInterview.com
Answered by: DEVARATHNAM C,KOTAGUDIBANDA,KALAKADA,CHITTOOR. | Date: 10/9/2007
| Contact DEVARATHNAM C,KOTAGUDIBANDA,KALAKADA,CHITTOOR.
yes we can extend one interface into another interface but we cannot extend one interface into class it is possible by using implementing one interface into class by using the keyword implements Source: CoolInterview.com
Answered by: gopal | Date: 2/24/2010
| Contact gopal
Ya we can extend interface like classes in java.. we can implement one class with one interface.. Ex:- interface clas extend school from this ex clas and school both are interfaces.. Source: CoolInterview.com
Answered by: YUVARAJ.M | Date: 7/19/2010
| Contact YUVARAJ.M
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|