+ 2
I want to know how java creators write code for java
what is inside the method like toUpperCase(); where can i find it
8 Réponses
+ 4
to uppercase() is one of many methods in string class, between the parentheses it takes in a string and then converts it to uppercase and returns the result back to were you called it.
+ 2
Sheraz Tariq
If you have a PC you can use an IDE to see the source code. src.zip is part of the JDK. Normally it is attached to the IDE.
For openJDK you can see it online: hg.openjdk.java.net
Choose a jdk for example jdk8.
(If I am correct sololearn uses openjdk14)
jdk8 (you can also choose another jdk) -> jdk -> browse (left side) -> src/ -> share/ -> classes/ -> java/ -> lang/ -> String.java
hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/java/lang/String.java
Now you see the whole source code of the String class.
Until java/ the steps should be for all classes the same. lang/ is the package. For example ArrayList is part of util, so you have to click util to find this class.
+ 2
Javadoc may help too.
+ 1
They do it similiar u would do it.
+ 1
can i see it
+ 1
I did not jump into all methods ;)
https://code.sololearn.com/ca7gcuctmIh0/?ref=app
Btw: Things getting complicated if you really want to know how a method works :D
0
Thanks
is there any specific place where can i find everything i want