Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Basic Java

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi all
What is the need for Interface in Java. As per my knowledge with interface we can create method declaration and it can be used by any implementing class. Implemeted class will make definition of the declared methods. Why cant we use classes and extneds this class. We can over ride the method. I assume that we can implement so many intefaces not extend so many classes. Other than multiple inherittance do we have any other benifit in interface... Please clarify my doubt.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This belongs in java in general beginner. Anyway, the choice between interfaces and abstract classes is up to you. If you dont have default implementations to provide go for interfaces. Else go for abstract classes
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please carefully choose the appropriate forum for your posts. This forum is for questions on Servlets.

This post has been moved to a more appropriate forum for you.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Also, do not double post. You end up wasting many people's time. John and Bear had to waste time on your post in the wrong forum.

We have a FAQ you should read. The relevant parts here are Choose One Forum and Use a Meaningful Subject ("Basic Java" is about as generic as you can get). It would probably be a good idea for you to read all of them, but these two in particular.

This thread is now closed
 
    Bookmark Topic Watch Topic
  • New Topic