wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Abstarct Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Abstarct Interface" Watch "Abstarct Interface" New topic
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: 14687
    
  16

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: 14687
    
  16

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 ..
 
Consider Paul's rocket mass heater.
 
subject: Abstarct Interface
 
Similar Threads
"Top Ten Topics that Everyone Thinks are on the SCJP Exam, but Aren't "- Bert Bates
interface extends interface ?
Bridge Design Pattern...
Does every interface extend class Object?
EJB 3 Client View