Java (was Re: [Tutor] impact of OO)

Paul Sidorsky paulsid@shaw.ca
Tue, 09 Apr 2002 01:27:12 -0600


Erik Price wrote:

> I like the name "Java" myself.  I also like "Python", though I'm not the
> craziest fan of the films (does that brand me a traitor in these
> parts?).  

I never liked the name "Java" actually but I guess it's not too bad. 
Also, no other language name (even Python) has given birth to so many
other names and ideas that revolve around its theme.  :-)

Anyhow, here are some quick answers since I'm not ready for bed yet.  I
have limited experience with Java, so you've been warned.

> What is a JavaBean?  

It's just a custom GUI component.  I think to be considered an actual
JavaBean it has to meet some kind of standard, but basically it's the
same thing.

> For that
> matter, I don't really understand what is the difference between Java 2
> and Java 2 Enterprise Edition.  Would someone please elaborate on that
> if possible?

Not really sure.  J2EE might support CORBA and a bunch of other
enterprise stuff, but that's just a guess.  Unless you're doing
something bleeding edge, Java 2 or even 1.2 or 1.3 should be fine.

> How is Python's organization less tree-like than Java's?  Is this
> related to the phrase "in Java everything is a class" that was mentioned
> last week (I think Alan suggested this)?

Yes, in Java everything except for the basic datatypes (int, float,
bool, etc.) descends from a class simply called "Object".  Also you can
ask Java to provide Object-based ints, etc. if you need them, e.g. to
store in a container (which store Object types of course).  So the
"family tree" of every class traces back to the Object type at some
point.

I suppose in many ways it's not really any different from Python, since
if you always used Object types for function parameters & returns you'd
be able to pass anything[1].  In Java it's just the whole thing is
highly formalized.

Java is generally a nice language, certainly nicer than C++.  Learn it
if you can, if nothing else just because it might be useful to know at
times.  Also it opens up Jython to you which certainly could be very
useful.  (One of my personal projects for the summer will be to do some
work with Jython just to see what it can do while brushing up my Java
knowledge at the same time.)

[1] Of course you would almost never want to do this because to operate
on an object of a specific type you always have to cast it.  The extent
that casting is needed in Java (at least in 1.x, I heard they were
slated to do something about it though) is one of those things you have
to just shake your head at and accept; once you can do this the language
as I said isn't all that bad.

-- 
======================================================================
Paul Sidorsky                                          Calgary, Canada
paulsid@shaw.ca                        http://members.shaw.ca/paulsid/