sun's source code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy

    sun's source code

    I use Netbeans to write all my code and I've noticed that if I do it
    wrong and the program throws an (unexpected) exception, it becomes
    possible to see the source code for the all the classes used leading
    up to the exception.

    I presume it must be possible therefore to somehow view the source
    code for all the classes in sun's library (e.g. Swing, awt, sql).

    I reckon this would be a pretty good way of learning how to write good
    java.

    How do you do it?

    Andy
  • Tim Lambert

    #2
    Re: sun's source code

    The source code (well a lot of it) is in the JDK.


    Comment

    • Roberto Nunnari

      #3
      Re: sun's source code

      Tim Lambert wrote:
      [color=blue]
      > The source code (well a lot of it) is in the JDK.
      >
      >[/color]

      it is in compressed file called src.zip in the JDK



      -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
      http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
      -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

      Comment

      • chris

        #4
        Re: sun's source code

        Andy wrote:
        [color=blue]
        > I use Netbeans to write all my code and I've noticed that if I do it
        > wrong and the program throws an (unexpected) exception, it becomes
        > possible to see the source code for the all the classes used leading
        > up to the exception.
        >
        > I presume it must be possible therefore to somehow view the source
        > code for all the classes in sun's library (e.g. Swing, awt, sql).
        >
        > I reckon this would be a pretty good way of learning how to write good
        > java.[/color]

        For professional reasons I've never looked at Sun's source code : however
        those that have tell me that it's nothing to write home about.

        You would do better to delete src.zip right away, and study the code of
        Wonka or Classpath instead. You'll find some good code there too, and more
        important you'll be able to do something with what you learn: improve some
        of the less good bits or fill in the gaps. With Sun's code, if something
        looks to you like it could be done better then there's not much you can do:
        with an open source project you can propose an improvement, and either you
        will be thanked or the original dveloper will tell you just why you're
        wrong. :)


        --
        Chris Gray chris@kiffer.eu net.be
        /k/ Embedded Java Solutions

        Comment

        Working...