P
puzzlecracker
Is it different from c++ in this regard?
Thx
Thx
Strongly typedpuzzlecracker said:Is it different from c++ in this regard?
Thx
Hal said:Strongly typed
Is it different from c++ in this regard?
Michael said:Hi puzzlecracker:
Java is statically typed because dynamically typed languages (such as
JavaScript and Visual Basic) allow you to write code like this:
var fred = "Fred";
//...
fred = 3.5;
This would obviously be illegal in Java and C++.
More details can be found at http://en.wikipedia.org/wiki/Data_type
Hope this helps...
Mike.
elaborate on how it relates to dynamically or statically typed
concepts.
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)
Thanks... that does it
Would an automatic registering of delegates make a language
dynamically typed?
Michael said:Hi puzzlecracker:
Can I assume that you are referring to C#?
I haven't made the plunge into the whole .NET thing, but I am aware of
the 'delegate' keyword. I did some surfing, and found the following
from Microsoft's MSDN page:
"A delegate declaration defines a reference type that can be used to
encapsulate a method with a specific signature. A delegate instance
encapsulates a static or an instance method. Delegates are roughly
similar to function pointers in C++; however, delegates are type-safe
and secure."
More details can be found at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcrefTheDelegateType.asp
Hope this helps...
Happy New Year!
Mike.
--- ACGNJ Java Users Group (http://www.javasig.org/)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.