Thursday, 28 March 2019

UGC NET Computer Science July 2018 - II | Question 7

Question 7
7. Which of the following statements is/are True ?
P : C programming language has a weak type system with static types.
Q : Java programming language has a strong type system with static types.
Code :
  1. (1) P only
  2. (2) Q only
  3. (3) Both P and Q
  4. (4) Neither P nor Q
Answer : (3) Both P and Q
  • Static Typing
    Essentially, static typing means that variable types are checked at “compile-time”, or before the code is executed.
  • Statement P is True.
    C programming language has a weak type system with static types because it lets you define object types as structures, but it doesn’t do much to enforce or remember them. C automatically convert between many types. C++ and Objective-C go further with the definitions but still don’t enforce the resulting types.
  • Statement Q is True.
    Java programming language has a strong type system with static types because Java forces you to define all types and checks them with a virtual machine.

Example of weak static languages: Weak Static Languages: C, C++ And Objective-C

Find here an example to understand strong static language: Strong Static Languages: Java

Both P and Q statements are true.

So, Option (1) is correct answer.

Reference : Understanding Types; Static vs Dynamic, & Strong vs Weak.


PreviousNext
UGC-NET CS 2018 July - II Question 6UGC NET CS 2018 July - II Question 8

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts