• Post Reply Bookmark Topic Watch Topic
  • New Topic

implement and extend order  RSS feed

 
raj kothari
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"By convention, the implements clause follows the extends clause, if there is one. "

This is from official java tutorial.
http://java.sun.com/docs/books/tutorial/java/IandI/usinginterface.html

Does it mean that it is only convention to specify the extend first and then implement next, and it is not rule/ compulsion?

But compiler gives error when implement is used first and then extend.
 
Majid Al-Fifi
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems it is a compulsary convention

You are right, at the link it says by convention but the compiler is enforcing it. how come???
 
Lorenz Baylon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We may extend only one class but may implement one to many interfaces. In that case, it would be more reader-friendly to have the extend-ing first before the implement-ing stuff.

Regards
 
Majid Al-Fifi
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are right good reasoning
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!