This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java terminology doubt

 
Ash Rao
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know if there is any specific terminology to denote the <extends> or <implements> keywords in a class declaration. i.e

public class Test extends SuperClass {
.........
}

public - access modifier
Test - class name

What would we call the <extends> part of the declaration? I hope my question is not cryptic.

Ash
 
Kedar Dravid
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
extends, implements are 'keywords' in Java.
These words are reserved � you cannot use any of these words as names in your programs.
extends - Inheritance
implements - Interfaces

extends always comes before implements in a class decalaration.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that most programmers refer to these simply as "the extends keyword" or "the implements keyword." The Java Language Specification refers to these as "clauses" -- as in "the extends clause" and "the implements clause." I don't know of anything more.

Ref: http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"extends" and "implements" by themselves are keywords, while "extends SuperClass" and "implements MyInterface" are examples of an extends clause and an implements clause, respectively.

From an English grammar standpoint, these aren't really clauses, as they don't have subjects. (Not included as part of the "clause" anyway.) But this isn't the first time existing terminology has been distorted in the making of a language specification. I suppose we can think of "extends SuperClass" as shorthand for "...which extends SuperClass" - which would be a clause, in English.
 
Ash Rao
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thx for the response. I guess for now we can accept that the said keywords are merely clauses in a class declaration.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic