File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is Strongly Typed?

 
Ram Venkata
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone explain me what do we mean by Strongly Typed?

Regards,
Ram
 
Sidd Kulk
Ranch Hand
Posts: 152
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ram, Welcome to Javaranch!!

Strongly typed is a characteristic of a language, because of which it becomes imperative to specify the type of variables. And it makes the inter type conversions bound by strict laws. It is applicable to both, primitives, as well as reference variables. You cannot assign a float to an int(of course, the other way round is possible because of implicit widening), and similarly, you can't assign a Dog reference to a Cat object, because they are of different TYPES.

Sid

[ May 02, 2007: Message edited by: Sidd Kulk ]
 
Ram Venkata
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sidd
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have to very carefully distinguish between three mostly orthogonal concepts here:

Static Typing means that *references* have types, that are checked at compile time. That is, the compiler checks that you don't assign incompatible types - you can't assign a Dog reference to a Cat reference. The opposite is Dynamic Typing. Java and C++ are statically typed languages, Ruby and Smalltalk dynamically typed, for example.

Strong Typing means that *objects* have types, that are checked at runtime. That is, the runtime environment checks that you don't send messages to objects that don't support those messages. The opposite is weak typing. Java and Smalltalk are strongly typed, basic C++ is weakly typed (although modern implementations add support for strong typing, if I remember correctly).

Manifest Typing means that you need to declare the type of references. The opposite is latent typing, where the (static) type of a reference is infered by the compiler. Java is manifestly typed, Scheme is an example of a latently typed language.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic