AboutNeal Ziring Expertise Almost anything about the core Java platform, with an emphasis on networking. Not familiar with JDBC or the new Java graphics APIs. [Sun Certified Java Programmer, JDK 1.1]
Experience Certified Java Programmer for JDK 1.1 and 2.0.
I'm just wonderin what does it mean that "Java is strongly typed".. I tried lookin it up but I'm still confused why some languages are considred strong or weak.. because of conversions across all types of variables or what exactly ??
I wish you can provide me with some detailed but simple explaination or some example..
Thank you.
Answer Munther,
The description "strongly typed" is very difficult to pin down.
Even computer science professors can have trouble with it. It
isn't a clear-cut issue.
There are a number of factors that make a language strongly
types. If it has some or all of those, then we may say the language
is strongly typed, otherwise we say it is weakly typed. Some of
those factors are:
1. Variables and other objects in the language must be declared
with a type. (Ex. Java v. Javascript).
2. Assignment of a value of one type to a variable of a conflicting
type causes an error to be raised (Ex. Java v. C)
3. During execution, every data value is explicitly or implicitly
qualified with its type, and decisions can be made about
types [i.e., introspection]
4. The language provides few or no means for bypassing the type
system (Ex. Java v. C)
5. Runtime-behavior or semantics of the language are explicitly
defined based on types (Ex. Pascal v. assembly)
By these criteria, Java and Ada are strongly typed, while C is
weakly typed. Javascript falls somewhere in the middle.