Results 1 to 11 of 11
Like Tree2Likes
  • 2 Post By Junky

Thread: Is it possible to see code of java methods.

  1. #1
    efozdel is offline Member
    Join Date
    Jul 2010
    Posts
    22
    Rep Power
    0

    Default Is it possible to see code of java methods.

    first of all, sorry for poor english

    My problem is that I would like to look at code of java-ready methods. For instance, clear() set() get(). These functions came with java and I want to investigate their implementations and code.

    Thanks in advance.

  2. #2
    stchman's Avatar
    stchman is offline Member
    Join Date
    Apr 2011
    Location
    Saint Louis, Missouri
    Posts
    97
    Rep Power
    0

    Default

    If you want to see the source code of any java class do the following:

    ex:
    Google

    java source string

    The first two hits are the source code:

    String.java in **6.0-JDK-Core**lang**java**lang**Java Source Code / Java Documentation Java Source Code and Java Documentation
    java.lang: String.java

    Inside the class contains all the methods.

    You could just as easily do:

    java source ArrayList
    java source BufferedReader
    java source Math
    If you aren't programming in Java, well that's just too bad.
    I'd rather be using Ubuntu.

  3. #3
    efozdel is offline Member
    Join Date
    Jul 2010
    Posts
    22
    Rep Power
    0

    Default

    Thank you so much.. Actually I could not find the exact key word to search on google. it helps so much.

  4. #4
    stchman's Avatar
    stchman is offline Member
    Join Date
    Apr 2011
    Location
    Saint Louis, Missouri
    Posts
    97
    Rep Power
    0

    Default

    What class is the get() set() and clear() methods in?
    If you aren't programming in Java, well that's just too bad.
    I'd rather be using Ubuntu.

  5. #5
    efozdel is offline Member
    Join Date
    Jul 2010
    Posts
    22
    Rep Power
    0

    Default

    those were just examples to make the question clearer. I am now looking for an e-book which covers most of famous methods of java. I am programming on java almost 1 years but I am still amateur and I think analyzing those source codes take me to one step further towards professionalism.

  6. #6
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default

    The source code of all classes in the Java API are located in the file src.zip in your Java directory. If you use an IDE then you should also be able to display the source code for classes. Simply click on the class name and "Go to source" or whatever the option is for your IDE.
    sunde887 and DarrylBurke like this.

  7. #7
    efozdel is offline Member
    Join Date
    Jul 2010
    Posts
    22
    Rep Power
    0

    Default

    I got them. Thanks both of you for your helps. How could I close this topic ?

  8. #8
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Don't worry about closing it, it will just die on it's own.

  9. #9
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default

    No it won't and stop narrowing your eyes at me.

  10. #10
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default

    By the way, has the rest of the planet been abducted by aliens? I go away for a few hours and not a single post has been made.

  11. #11
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

Similar Threads

  1. Replies: 8
    Last Post: 04-16-2012, 11:00 PM
  2. Source code of Predefined classes and methods
    By lobodelbosque in forum New To Java
    Replies: 8
    Last Post: 08-10-2011, 02:11 PM
  3. Replies: 0
    Last Post: 02-21-2011, 11:50 AM
  4. Convert java code to midlet code
    By coldvoice05 in forum New To Java
    Replies: 1
    Last Post: 08-12-2009, 11:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •