• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java terminology doubt

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic