• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

API functionality

 
sai donthneni
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does API functionality of a method means?
 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give the context please with this thread. Then Only we can understand what do you want to know exactly
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One doesn't talk so much about the API of a method, but the API of a class (or a package, or a library). That refers to the methods in a class that are publicly accessible. The javadocs for a class list all the public methods - those make up the API of the class.
 
sai donthneni
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The statement is as follows. "The final keyword prevents a method from being overridden in a subclass, and is often used to enforce the API functionality of a mthod".

What does API functionality of a method mean?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting choice of words. It means that the class author defined the API for the class and the author does not want anyone to extend the class and somehow alter the functionality. He used the "final" keyword to enforce his decision that you shouldn't override this method to do something different.

There are some pretty good arguments for making all methods final, though few people actually bother to do it. If you're curious, scroll down to the OO, UML, etc forum and ask about the Liskov Substitution Principle.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic