This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes problem with java documentation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem with java documentation" Watch "problem with java documentation" New topic
Author

problem with java documentation

pras
Ranch Hand

Joined: Apr 04, 2007
Posts: 188
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
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
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).


Ping & DNS - my free Android networking tools app
pras
Ranch Hand

Joined: Apr 04, 2007
Posts: 188
hi Ulf Dittmer,

if a client class cannot access such methods? then what actually is the use of such methods.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with java documentation
 
Similar Threads
Working with HashMap
Is HashMap.put() atomic?
hashmap and equals doubts
Duplicates in HashSet
Need help in understanding the internal working of HashMap and HashTable.