MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following comparisons between static and dynamic type checking is incorrect?
A
Dynamic type checking slows down the execution
B
Dynamic type checking offers more flexibility to the programmers
C
In contrast to Static type checking, dynamic type checking may cause failure in runtime due to type errors
D
Unlike static type checking, dynamic type checking is done during compilation
Explanation: 

Detailed explanation-1: -Which of the following comparisons between static and dynamic type checking is incorrect? Explanation: A language is statically-typed if the type of a variable is known at compile time instead of at runtime.

Detailed explanation-2: -It’s useful to think about three kinds of automatic checking that a language can provide: Static checking: the bug is found automatically before the program even runs. Dynamic checking: the bug is found automatically when the code is executed. No checking: the language doesn’t help you find the error at all.

Detailed explanation-3: -Static type checking is performed by a compiler, whereas terminal dynamic type checking is performed when the target program is run. Since a source type system allows us to know statically that type errors will not occur when the target program executes; it eliminates dynamic type checking requirements.

Detailed explanation-4: -Dynamic typing-the type is associated with the value, and checked at run-time. Static typing-type is associated with variable or textual expression, and checked at compile-time.

There is 1 question to complete.