abstract interface

Does it make any sense if i declare an interface as abstract. If yes, What is the difference between ordinary interface and thise one. Please in detail.
Who is Participating?
AlexJ030200Connect With a Mentor Commented:
A feature in the javadoc application makes that all the interfaces are displayed as if they were abstract. For instance, in the javadoc page for interface HttpServletRequest it is written

public abstract interface HttpServletRequest ...

while its source says

public interface HttpServletRequest

This leads to the confussion expressed in this question.

Of course, the answer is that it does not make any sense.
as far as I remember 'abstract interface' keyword remains from Java 1.0 and does not have any special meaning any more (Java 1.1+). use 'interface' instead.

(you may want to check the Java Language Specification yourself :)
From Section titled 'abstract Interfaces'

Every interface is implicitly abstract. This modifier is obsolete and should not be used in new Java programs.

>>>Please in detail.
That is all there is to say ,nothing more to it.
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.


interface itself is a abstract class. NO need to explicitly tell as abstract.
>>>interface itself is a abstract class.
interface is a skeleton and class is a body,
and a abstract class is mostly a body with little skeleton,i.e it can have real code and some abstract method(s).

>>>NO need to explicitly tell as abstract.
There was a valid way of specifying it and it's obsolete now.

Sometimes there is a need to specifically stress a thing ,even though ALL methods and constant data in a interface is public to the package by default and you are only interested in using that interface in package foobar.

An interface declaration cna be preceded by interface modifiers:
which can be one of 'public' & 'abstract'
What was that again Ravi??

An interface is an abstract class??

Then pray please tell me as to why we "extend" an abstract class and "implement" an interface??

Java introduces interfaces to recover much of the functionality that multiple inheritance gives you.

I typed abstract class mistakenly. My meaning is

interface itself is abstract.

no implementation.

abstract in the sense not abstract tag in java. It is just a general concept.


Now my comment is

interface itself is a abstract // Here Abstact int the sense generally dictionary meaning. left undefined.

.. NO need to explicitly tell as abstract.

Now this abstract is abstract keyword in java.

Sorry. I did n't clearly explined the my message.

Hi AMit and Rainmal:-
 Am i correct now??

 Mistankley class came in typing chagned the whole meaning of my comment

yes it happens sometimes to all of us at sometime in our life.
However in the HttpServletRequest class, it is a abstract interface class,

why it has its own object and its method?

That is

request.getParameter("xxx");  where request is the object of HttpServletRequest.

In this case, the getParameter is a abstract interface class should not have implementation.  Why it still can call this function?

Moreover, abstract class cannot be instantiated, why HttpServletRequest has its own object, called request?

Pls tell me, I am very puzzling about abstract interface.

request is instance of some class that implements the HTTPRequest interface.

System.out.println("class: " + request.getClass().getName())

to see tha class name.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.