File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abstarct Interface

 
Manoj Agnihotri
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody explain about abstract interfaces ?
What is the significance of these interfaces ?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's clear up some Java terminology first There is no "abstract interfaces" in Java. There are interfaces, and abstract classes.
 
Manoj Agnihotri
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


abstract keyword is allowed to use like this.
I want to know if it is allowed then what's the use of this ?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abstract interface example

Nice But in Java, this is still called an interface. Not an abstract interface An interface is by definition purely abstract, because it cannot do anything concretely. This declaration is redundant, so we usually (always?) omit the "abstract" keyword to define an interface.

By the way, your interface could also be written like this :

but people usually write it like this :
 
sachin verma
Ranch Hand
Posts: 177
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can use this before any interface like you did.

An interface is implicitly abstract so there is no need to declare it abstract.
As interface variables are all implicitly public static final whether you declare it or not.
So it would create redundancy to use abstract in interface declaration and public static final in constant declaration.
[ April 30, 2008: Message edited by: sachin verma ]
 
Manoj Agnihotri
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ..
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic