This morning was going through a book where I found a paragraph as stated below :
Each data field in a table is a strongly typed data member, fully compliant with .NET’s Common Type System.
Does the above lines means " that objects written in different languages can interact with each other like "
And if it means the above lines what does exactly the above line means by saying different languages can interact with each other like
I am trying to work out with an example but no success till now.
Or is it something that i am missing and need to know. Please help me to understand.
Thanks in advance
The C# language is a strongly typed language: this means that any attempt to pass a wrong kind of parameter as an argument, or to assign a value to a variable that is not implicitly convertible, will generate a compilation error. This avoids many errors that only happen at runtime in other languages.
What Does Strongly Typed Mean? Strongly typed is a concept used to refer to a programming language that enforces strict restrictions on intermixing of values with differing data types. When such restrictions are violated and error (exception) occurs.
"Weakly typed" means "this language uses a type verification system that I find distasteful", and "strongly typed" means "this language uses a type system that I find attractive".
Strongly typed means, a variable will not be automatically converted from one type to another. Weakly typed is the opposite: Perl can use a string like "123" in a numeric context, by automatically converting it into the int 123 . A strongly typed language like python will not do this.
For e.g you cannot Multiply or Divide two different types i.e String vs Integer
var answer = 1 * "1"; // you cannot do this
You have to explicity cast it, this is known as strongly typed
where as if you see in php
$x = "3" * 1; // is correct in php
So here you dont need to explicitly cast it.
When we say something is strongly typed we mean that the type of the object is known and available.
Let say I have a function like following
public int Add(int a, int b){ return a+b; }
We can call this function like
int result = Add(5,4);
But we can not do like following
int result = Add(5.2,4.5); // We will get here compilation error.
C# (and C++ and many other languages) is strongly typed because the compiler will detect and flag these errors at compilation time.
See here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With