Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with java documentation

 
pras
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

when i saw the java API specification there are few methods listed

but when i see the real HASHMAP.java class using IDE i see more methods which are not listed in API? why?

one such example is
/****************************
void createEntry(int hash, Object key, Object value, int bucketIndex) {
table[bucketIndex] = new Entry(hash, key, value, table[bucketIndex]);
size++;
}

*************************/
can someone help?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally, class library methods that have private and package access are not listed in the API, because a client class can not use them.

Note that I said "class library methods", which means methods in classes that are in one of the java.* packages. You can't define classes in the java.* class hierarchy, so methods that have package access are not usable (and private methods are not usable no matter which package is involved).
 
pras
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Ulf Dittmer,

if a client class cannot access such methods? then what actually is the use of such methods.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class itself can use those methods, and -in the case of package access, like the method you showed- so can other classes in the same package.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic