| Author |
Abstarct Interface
|
Manoj Agnihotri
Greenhorn
Joined: Nov 14, 2006
Posts: 11
|
|
Can anybody explain about abstract interfaces ? What is the significance of these interfaces ?
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
Let's clear up some Java terminology first There is no "abstract interfaces" in Java. There are interfaces, and abstract classes.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Manoj Agnihotri
Greenhorn
Joined: Nov 14, 2006
Posts: 11
|
|
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
Joined: Nov 24, 2005
Posts: 14685
|
|
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
Joined: Mar 25, 2008
Posts: 177
|
|
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 ]
|
SCJP || SCWCD
|
 |
Manoj Agnihotri
Greenhorn
Joined: Nov 14, 2006
Posts: 11
|
|
Thanks ..
|
 |
 |
|
|
subject: Abstarct Interface
|
|
|