Hi "egao1980":
> Java is strongly typed with some hole near collections (patched with
> generics in java 5.0) but It is possible to write "dynamically
> typed"-like code in Java - declare all variables as Object and use
> reflection to call methods an do other things around ^_^ (similar to
> Smalltalk but ugly in syntax)
I hear what you're saying, but I still think there is a big difference
between declaring variables as type Object and variables in dynamically
typed (scripting) languages.
Type Object is still just that, a type. As you probably already know,
a cast is usually required to change over to a more specific type (like
iterating through a collection before Generics). Reflection, of
course, also deals with specific class types.
On the other hand, variables declared in a scripting language can be
dynamically assigned to another data type (like the example I gave
earlier in this thread) without the need for casting. But, one has to
wonder how all that magic happens in the background.
So, you bring up an interesting point.
Here's something for all of us to ponder for the new year...
Happy New Year!
Mike.
--- ACGNJ Java Users Group (http://www.javasig.org/)