• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Source code for library classes/methods?

 
Ranch Hand
Posts: 34
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys

Im a beginner doing some random programs here and there and finding the java libary very usefull. There is one thing though, where can I find the source code for the methods I use. Like for example im trying to find how the String Class Replace method was done, but I cant find this anywhere. Doing a search only takes you to example that used it

Thanks
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try searching for "java source code"?
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Christiaan Thamm wrote:where can I find the source code for the methods I use. Like for example im trying to find how the String Class Replace method was done...


There's nothing particularly wrong with looking at source code to "find out how the experts do it", but do be very careful that you don't fall into the trap of writing programs that rely on (or assume) a particular implementation.

There's a reason the designer hid the source from you: they might want to change it later.

Also: while you can get source for most of the Java foundation classes, you may not be able to get it for 3rd party libraries or jars.

Winston
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One thing I have found useful with Maven is that it makes it easy to download the source from 3rd party open source libraries for you. Also, if you use m2eclipse to open maven projects from Eclipse, Eclipse automatically downloads the source of a class when you open a class. It makes solving problems a breeze. Most of the problems with 3rd party libraries is either that the programmer didn't understand the API, or the API wasn't documented well. Being able to debug through 3rd party libraries seamlessly through the IDE makes solving problems so much easier.
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic