wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Interfaces...need some help. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Interfaces...need some help." Watch "Interfaces...need some help." New topic
Author

Interfaces...need some help.

SurferBoy
Greenhorn

Joined: Nov 20, 2004
Posts: 7
im learning java from a book...
the problem is ..that i cant really understand the idea behind interfaces.
tried looking for some help on "google"...but to no avail.
i know that java doesnt support multipile inheritance of classes...
but if interfaces doesnt allow implementations...(of methods and variables) so what the use of them anyway???
(if u have an example..it would be great)
thanks in advance...
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Hi Joe nothing,

Welcome to JavaRanch! Please adjust your display name to meet the JavaRanch Naming Policy. If you don't want to use your own name, at least pick a name that looks real. You can change it here.

Thanks!


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10

the problem is ..that i cant really understand the idea behind interfaces.
tried looking for some help on "google"...but to no avail.


You could try the "Search" link at the top right of this page. Or you could go to the main JavaRanch page and use the Google there to search either the static Javaranch pages or the Moose Saloon (this forum).

i know that java doesnt support multipile inheritance of classes...
but if interfaces doesnt allow implementations...(of methods and variables)


What makes you think that you can't implement an interface? That is the whole function of an interface -- to provide a contract to be implemented by one or more classes.
Pritam Barhate
Greenhorn

Joined: Nov 25, 2004
Posts: 15
Interfaces is a very powerful tool that lets you to have many functionalities of multiple inheritance without complexities of multiple inheritance. Almost all of the collections framework is based on interfaces.

Try to work with collections framework (I am sure your book will have atleast one chapter on it) and you will understand power of interfaces as well of their uses in real world programming.


Pritam Barhate<br />A magic combination of <b>Code</b> & <b>Fire</b> : <a href="http://www.jroller.org/page/codefire/Weblog" target="_blank" rel="nofollow">codefire</a><br />----------------------------------- <br />My Open Source Projects:<br /><a href="https://acemdi.dev.java.net/" target="_blank" rel="nofollow">AceMDI</a>: A easy, yet powerful MDI framework that manages windows as Tabs.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interfaces...need some help.