Results 1 to 2 of 2
Thread: how to implement interface
- 12-09-2008, 02:11 PM #1
how to implement interface
i create interface
interface arith
{
int sum(int a,int b);
int sub(int x,int y);
}
when i implenent this interface i only define int sum(int a,int b);
but i got a error that the function sub did not define.but i only access sum function only not sub.....
should we define all declare function in interface?....
- 12-09-2008, 02:39 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
When you implement an interface you must implement all methods in that interface in the implementing class.
Can you show how you implement that interface.
Similar Threads
-
Can generic types implement an interface?
By jdgallag in forum New To JavaReplies: 3Last Post: 10-30-2008, 04:07 AM -
Requesting some tips to implement an interface between a tree structure and table
By Karanam in forum AWT / SwingReplies: 1Last Post: 10-20-2008, 12:58 PM -
How to implement the Icon interface in Java
By Java Tip in forum java.awtReplies: 0Last Post: 06-23-2008, 11:17 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks