Is there any way to actually see the source code of standard java classes by the way? I’m making a hash table of points (HashSet<Point>) and I want to make sure that it will hash well, but I can’t see what Point’s hashCode() method actually looks like, so I don’t know how good it really is. Can anyone help me? Should I override it? And if so, is there an easy way to do this without creating a whole new java file/class?
Is there any way to actually see the source code of standard java classes
Share
If you’re searching for the
hashCode()ofjava.awt.Point, it is defined injava.awt.geom.Point2D.Note that the question “Will it hash well?” is hard to answer, it depends primarily on usage pattern.
You can access the source code of nearly all “standard Java classes”, just search for the
src.zipfile in your JDK installation directory (or use an IDE like Eclipse/NetBeans and click F3 on the class name).