473,789 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 17 '05 #1
3 1706
The source code (well a lot of it) is in the JDK.
Jul 17 '05 #2
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
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.eu net.be
/k/ Embedded Java Solutions

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5843
by: Chris Grimble | last post by:
I have a very simple applet that I am trying to make compatible with both Microsoft's JVM and Suns JVM in Internet Explorer. However, when I turn on the Sun JVM it works occasionally, but frustratingly on most occasions I get the following error messages: In the status bar: "Applet <name> notinited" And when I investigate further in the console I get the following output:
1
2403
by: John Dumais | last post by:
Hello, I have a templated class defined in a header file and implemented in a cpp source file. The class is basically a little marshaler that contains a factory method and a few marshaling functions. The template parameter defines the type stored in a contained vector. That class is built into a shared library. The (condensed) code goes like this...
2
2360
by: qazmlp | last post by:
When I compile my C++ source code, I am getting hundreds of following warning. "/opt/SUNWspro/WS6U1/include/CC/Cstd/./ios", line 148: Warning: std::basic_ios<char, std::char_traits<char>>::copyfmt hides the function std::ios_base::copyfmt(const std::ios_base&). I understand that, this is a design flaw in Sun C++ compiler implementation. Here is the compiler installed in my machine:
3
3654
by: modemer | last post by:
Hello, I got weird compiling message similar like following when I compiled my simple code on Sun 5.8 with CC WorkShop 6 update 2 C++ 5.3. CC -g -o myclass.o -c myclass.cpp CC -g -o main.o -c main.cpp CC -g -L/usr/lib -lsocket -lnsl -o main myclass.o main.o __1cH__rwstdJ__rb_tree4CpknJmyclassHCSOCKET_nDstdEpair4Ck4n0BNCSOCKEVENTMGRJ SOCKEVENT___n0AL__select1st4n0G_C4__n0DEless4C4__n0DJallocator4n0G____Efind6
1
1869
by: Karl Meise | last post by:
I'm about to embark on recompilation of a basic interpreter that was last compiled with Sun C 3.0. I understand that there are substantial differences between Sun C versions 3.0 and 4.2 (for which there is backward compatibility with current version). I'm getting Sun Studio 11 in the hope that it will provide me with greater compatibility than newer versions of gcc. All I have is sparsely commented source code. Does anyone know of...
12
1822
by: howa | last post by:
any side effect for PHP? what do you think?
27
3078
by: Dave | last post by:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU compilers. I then decided to try to use Sun's compiler. The Sun Studio 12 compiler reports the following code, which is in the source (gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error. I'm inclined to agree, as it is like no C I have ever met. what is "C_COMMON_FIXED_TYPES (, fract);" supposed to mean? Could it be
2
1531
by: sunil | last post by:
reading http://docs.sun.com/source/819-3690/Program_Org.html#37468, I see there are two ways to instantiate templates: template definitions included, template definitions separate, does template definitions separate mean there will be only one copy of instantiated template code per type ? Also the compiler options: -instances=static,global,explicit atleast last three mention they work only with definition included, - instances=extern...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.