By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,650 Members | 753 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,650 IT Pros & Developers. It's quick & easy.

sun's source code

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
The source code (well a lot of it) is in the JDK.
Jul 17 '05 #2

P: n/a
Tim Lambert wrote:
The source code (well a lot of it) is in the JDK.


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! =-----
Jul 17 '05 #3

P: n/a
Andy wrote:
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.


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 ch***@kiffer.eunet.be
/k/ Embedded Java Solutions

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.