hi all
I want to know how can I find the implementation of some classes in java
ex. I want to know the implementation of method charAt in class string
implementation of ready classes
Started by eman ahmed, Sep 24 2010 08:57 AM
7 replies to this topic
#1
Posted 24 September 2010 - 08:57 AM
|
|
|
#2
Posted 24 September 2010 - 10:14 AM
Download java source code: http://www.java.net/...30_aug_2010.jar
it's all there.
as you might have guessed. String is actually array of chars, and charAt returns a certain character from the array.
it's all there.
public char charAt(int index) {
if ((index < 0) || (index >= count)) {
throw new StringIndexOutOfBoundsException(index);
}
return value[index + offset];
}
as you might have guessed. String is actually array of chars, and charAt returns a certain character from the array.
#3
Posted 24 September 2010 - 10:17 PM
I downloaded JDK, but I'mnot found what I search
#4
Posted 24 September 2010 - 11:31 PM
If you're using eclipse i believe it's ctrl+shift+T or so, it's called "open type" and if you type "String" there, or any other class it will open it. Other IDEs most likely also have such a feature.
#5
Posted 25 September 2010 - 01:37 AM
Oxano, i don't think Eclipse comes with the source. I believe it only contains the compiled bytecode by default. It's "control" key, that takes user to the requested source, but it just says "source not found".
eman ahmed, look at there: \j2se\src\share\classes\java\
eman ahmed, look at there: \j2se\src\share\classes\java\
#6
Posted 25 September 2010 - 01:42 AM
never mind :-P
#7
Posted 26 September 2010 - 05:06 AM
thanks to all , but I'm still have the same problem
#8
Posted 26 September 2010 - 05:36 AM
In 'C:\Program Files\Java\jdk1.6.0_21' (jdk version may vary) I got this file 'src.zip' which contains all the .java files of all the classes.


Sign In
Create Account


Back to top









