• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abstract interface?

 
Bala Krishna
Ranch Hand
Posts: 95
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know what abstract classes and what interfaces are. But, whey would we need to declare an interface as 'abstract'? For ex: (FilterChain interface of javax.servlet.http). I do not see any necessity of declaring an interface as an abstract. Am I missing something? Can some one please shed some light?
-Bala
 
Jacky Chow
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
interfaces are implicitly abstract, that means use or not use the abstract key word with interface are the same.
 
Bala Krishna
Ranch Hand
Posts: 95
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly my point. Why use the word 'abstract' when it's not needed? It's like saying JSP page.
 
Wilfried LAURENT
Ranch Hand
Posts: 269
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what the JLS says in 9.1.2.1 abstract Interfaces
"Every interface is implicitly abstract. This modifier is obsolete and should not be used in new Java programs. "
W.
 
Bala Krishna
Ranch Hand
Posts: 95
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for clarifying that Wilfried. So, what does this mean? That the people who wrote the lattest Servlet API would did NOT read the JLS?
And I thought I was the only one who tried to learn Java without reading the JLS. hehe!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic