Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes What does strongly typed language mean? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What does strongly typed language mean?" Watch "What does strongly typed language mean?" New topic
Author

What does strongly typed language mean?

Chandra Bairi
Ranch Hand

Joined: Sep 12, 2003
Posts: 152
What is meant by strongly typed and give me some languages which are strongly typed


Thanks,
Shekar
jyothsna kumari
Ranch Hand

Joined: Jul 21, 2003
Posts: 108
hai,
hope this will get u some idea regrading u'r question.

A language is strongly typed if type annotations are associated with variable names, rather than with values. If types are attached to values, it is weakly typed.
A language is strongly typed if it contains compile-time checks for type constraint violations. If checking is deferred to run time, it is weakly typed.
A language is strongly typed if there are compile-time or run-time checks for type constraint violations. If no checking is done, it is weakly typed.
A language is strongly typed if conversions between different types are forbidden. If such conversions are allowed, it is weakly typed.
A language is strongly typed if conversions between different types must be indicated explicitly. If implicit conversions are performed, it is weakly typed.
A language is strongly typed if there is no language-level way to disable or evade the type system. If there are casts or other type-evasive mechanisms, it is weakly typed.
A language is strongly typed if it has a complex, fine-grained type system with compound types. If it has only a few types, or only scalar types, it is weakly typed.
A language is strongly typed if the type of its data objects is fixed and does not vary over the lifetime of the object. If the type of a datum can change, the language is weakly typed.
Amit KumarS
Ranch Hand

Joined: Oct 10, 2003
Posts: 100
hi
By Strongly Typed Language we mean that for conversion of data and object you need to explicitly Type cast them..
for example you need to convert a double to float then you need to write

if u omit the casting (float) then compiler will throw an error.
u can say java is strongly typecasted language but in this also you need not typecast variables when u are going for conversion from lower capacity variables to higher capacity varibles... (i am sure u know all this)
Thanks
Amit


****************************<br />In 24 hrs Earth rotates once on its Axis.
Amit KumarS
Ranch Hand

Joined: Oct 10, 2003
Posts: 100
impressive stuff jyothsna
jyothsna kumari
Ranch Hand

Joined: Jul 21, 2003
Posts: 108
hey Amit,
thanks and btw nice answer.
jyothsna
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Sorry, but I think you got it wrong...
A strongly typed language is a language where an object has a type, so that at runtime it can be verified wether a specific operation is allowed on an object.
Java is a strongly typed language - it will throw an exception when you typecast an object to an incompatible type. Smalltalk is strongly typed, too - though it doesn't need typecasts - here a method call on an object will result in a call to methodNotUnderstood (iirc) if an object doesn't know about the operation.
In contrast, C++ is weakly typed - you can cast any object to any type and call methods on it. If you cast an object to an incompatible type, it can lead to nasty problems, but wouldn't be cought by the type system. (Actually, modern C++ includes language constructs to add strong typing, but you still can circumvent them.)
As you can see, this is orthogonal to variables having types, which is called static typing. Java is a statically typed language, whereas Smalltalk is a dynamically typed language - in the latter, any variable can reference an object of any type; type-safety is only enforced at runtime, not at compile time.
I hope this helps...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What does strongly typed language mean?
 
Similar Threads
What is Strongly Typed?
AOP
Strongly typed and Weakly typed languages
strongly type ?
What is Strongly Typed?