Results 1 to 4 of 4
Thread: interface help
- 05-03-2011, 08:34 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 57
- Rep Power
- 0
interface help
So I have following code fragement:
I need to develop a LibraryFactory interface to make this work, I tried to develop this:Java Code:LibraryFactory f = new DefaultLibraryFactory(); Library l = f.createArchive( f.createSong(), f.createSong(), f.createGroup(3, f.createSong()) );
Somethings seems off to me, can any guide me in the right direction?Java Code:interface LibraryFactory { Object createSong(); Object createGroup(int i, Object createSong); Library createArchive(Object createSong, Object createSong2, Object createGroup); }Last edited by alpdog14; 05-03-2011 at 08:38 PM.
-
No, it looks quite alright to me.. I just think interfaces maybe simpler than you think
- 05-04-2011, 12:01 AM #3
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
As ozzy said, your interface looks fine. Interfaces are actually fairly simple. All they do is list a bunch of abstract method and any class that implements them is responsible for providing a definition for each method.
Would you mind saying what you think seems off?
- 05-04-2011, 11:17 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
Interface?
By maknib in forum New To JavaReplies: 52Last Post: 11-05-2010, 10:22 AM -
How do I use an Interface for this?
By aaronfsimons in forum New To JavaReplies: 14Last Post: 06-22-2009, 02:19 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks