Tag: programming languages

Questions Related to programming languages

  1. No

  2. Yes, but only if the two classes have the same name

  3. Yes, but only if the main program does not declare both kinds

  4. Yes, this is always allowed


Correct Option: D
  1. Inherits data members and member functions from base class

  2. Inherits constructors and destructor

  3. Object can access protected members with the dot operator

  4. Inherits data members and member functions from base class as well as Inherits constructors and destructor


Correct Option: D
  1. Polymorphism

  2. Inheritance

  3. Overloading

  4. None of these options


Correct Option: B
  1. Zero instance

  2. Multiple instance

  3. Both Zero instance & Multiple instance

  4. None of these options


Correct Option: C
  1. Serialization

  2. Persistence

  3. Marshalling

  4. None of these options


Correct Option: B
Explanation:

To solve this question, the user needs to understand the concept of object-oriented programming and the terminology used in it.

The state of an object refers to the values of its attributes or properties at a given point in time. Maintaining the state of an object means preserving these values so that they can be used later, even after the program has ended.

Now, let's go through each option and explain why it is right or wrong:

A. Serialization: Serialization refers to the process of converting an object into a format that can be stored or transmitted. While serialization can be used to maintain the state of an object, it is not the same thing as maintaining the state.

B. Persistence: This option is correct. Persistence refers to the act of preserving data beyond the lifetime of a program. In the context of object-oriented programming, persistence means maintaining the state of an object so that it can be used again later.

C. Marshalling: Marshalling is a technique used to transfer data between different applications or systems. While marshalling can be used to preserve the state of an object during transfer, it is not the same thing as maintaining the state.

D. None of these options: This option is incorrect because option B, Persistence, is the correct answer.

Therefore, The Answer is: B. Persistence.

  1. Only with a double line between base class & derived classes

  2. A plane line with no shape on either end

  3. A line with an arrow-head pointing in direction of parent or superclass

  4. Diamond shape between classes


Correct Option: C
  1. Association

  2. Aggregation

  3. Link

  4. None of these options


Correct Option: A