in Programming in C recategorized by
3,982 views
3 votes
3 votes

Which of the following comparisons between static and dynamic type checking incorrect?

  1. Dynamic type checking slows down the execution
  2. Dynamic type checking offers more flexibility to the programmers
  3. In contrast to Static type checking, dynamic type checking may cause failure in runtime due to type errors
  4. Unlike static type checking dynamic type checking is done during compilation
in Programming in C recategorized by
by
4.0k views

6 Comments

sir i think option C is correct. There are a lot of causes may result in runtime errors, such as incompatible type-casting, referencing an invalid index in an array, using an null-object, out of memory situations, thread dead-locks, etc.
0
0

Ans will be A) Dynamic type checking can never be slower than static type checking

https://stackoverflow.com/questions/2198684/are-dynamic-languages-slower-than-static-languages

2
2

@srestha

Your reference is about Dynamic languages.It is not important that all dynamic languages are dynamically typed as well.

Refer

Slide No.8

0
0
@VS
without compilation running also not possible
Static type checking is part of dynamic type checking
That is why  I thought among option 1) and option 4) , option 1) can be better choice
right?
0
0
@srestha What exactly is that link saying? See the selected answer there. Even the most liked answer is not saying otherwise - it mainly points the problem in the question.
1
1
edited by

ok, I accept D) is most liked

Moreover dynamic language faster than compiler, but dynamic type checking is slower(because runtime we need to validate every code)

https://stackoverflow.com/questions/41622341/why-is-type-checking-expensive

0
0

1 Answer

11 votes
11 votes
Best answer

ANSWER : D

Static Type Checking

A language is statically-typed if the type of a variable is known at compile time instead of at runtime. Common examples of statically-typed languages include Ada, C, C++, C#, JADE, Java, Fortran, Haskell, ML, Pascal, and Scala.

Dynamic Type Checking

Dynamic type checking is the process of verifying the type safety of a program at runtime. Common dynamically-typed languages include Groovy, JavaScript, Lisp, Lua, Objective-C, PHP, Prolog, Python, Ruby, Smalltalk and Tcl.

So, dynamic type checking offers more flexibility to the programmers at the expense of runtime type checking overhead and possible runtime type errors. 

selected by
Answer:

Related questions