0

programming languages Online Quiz - 74

Description: programming languages Online Quiz - 74
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

If a catch statement is written to catch exception objects of a base class type, it can also catch all _____ derived from that base class

  1. Exceptions for objects

  2. Objects of classes

  3. Arguments

  4. Errors


Correct Option: A
  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

Suppose that the Test class does not have an overloaded assignment operator. What happens when an assignment a=b; is given for two Test objects a and b?

  1. The automatic assignment operator is used

  2. The copy constructor is used

  3. Compiler error

  4. Run-time error


Correct Option: B

Peer-to-peer relationship is a type of _________.

  1. Association

  2. Aggregation

  3. Link

  4. None of these options


Correct Option: A

Which of the following are good reasons to use an object oriented language.

  1. You can define your own data types

  2. An object oriented program can be taught to correct its own errors

  3. It is easier to conceptualize an object oriented program

  4. You can define your own data types and It is easier to conceptualize an object oriented program


Correct Option: D

AI Explanation

To answer this question, we need to understand the benefits of using an object-oriented language. Let's go through each option to determine which ones are good reasons to use an object-oriented language:

Option A) You can define your own data types - This option is a good reason to use an object-oriented language. Object-oriented languages allow you to create and define your own data types, which can help you model real-world entities or abstract concepts more effectively.

Option B) An object-oriented program can be taught to correct its own errors - This option is not a good reason to use an object-oriented language. The ability to correct errors in a program depends on the specific development practices and tools being used, rather than on the choice of programming paradigm (such as object-oriented).

Option C) It is easier to conceptualize an object-oriented program - This option is a good reason to use an object-oriented language. Object-oriented programming provides a natural way to organize and structure code by modeling the problem domain as a collection of interacting objects. This can make it easier for programmers to understand and conceptualize the program.

Option D) You can define your own data types and It is easier to conceptualize an object-oriented program - This option is a good reason to use an object-oriented language. As explained above, both of these reasons (defining your own data types and easier conceptualization) are advantages of using object-oriented languages.

Based on the analysis above, the correct answer is D.

What is the result of this code? myObj *foo = operator new(sizeof(foo));

  1. That's not legal syntax!

  2. foo has memory allocated for it, but is not constructed

  3. foo has memory allocated for it, and is fully constructed

  4. None of the above


Correct Option: A

What is wrong with the following code? int * x = (int *) malloc(100 * sizeof(int)); x = realloc(x, sizeof(int) * 200);

  1. If realloc fails, then the original memory is lost

  2. Nothing, realloc is guaranteed to succeed (by returning the original pointer)

  3. Nothing, realloc frees the original memory passed to it

  4. None of the above


Correct Option: A
  1. Information hiding

  2. Minimizing interdependencies among modules

  3. Make implementation independent

  4. All of these options


Correct Option: A

When a class uses dynamic memory, what member functions should be provided by the class?

  1. An overloaded assignment operator

  2. The copy constructor

  3. A destructor

  4. All of these options


Correct Option: C
  1. Data Encapsulation, Inheritance & Exception handling

  2. Inheritance, Polymorphism & Exception handling

  3. Data Encapsulation, Inheritance & Polymorphism

  4. Overloading, Inheritance & Polymorphism


Correct Option: C

Reusability can be achieved through?

  1. Inheritance

  2. Composition

  3. Association

  4. All of these options


Correct Option: C

We can write any C# code on the code behind of workflow. True or false

  1. True

  2. False


Correct Option: B
  1. using Bookmark resumption

  2. Using InArgument

  3. Using variables

  4. using bookmark resumption and using InArgument

  5. None of this


Correct Option: D

How to access an outargument in the designer

  1. using variable assigned to the OutArgument

  2. Using InArgument assigned to the OutArgument

  3. It is not possible

  4. None of the above


Correct Option: A

How to resume a bookmark

  1. workflowApplication.ResumeBookmark(bookmarkName, null)

  2. workflowApplication.ResumeBookmark(bookmarkName)

  3. workflowInvoker.ResumeBookmark(bookmarkName, null)

  4. workflowInvoker.ResumeBookmark(bookmarkName)


Correct Option: A

How to define a designer for an activity

  1. Add the Designer attribute to the Activity class

  2. Assign ActivityDesigner name in the Activity Constructor

  3. By overriding cacheMetadata

  4. None of the above


Correct Option: A

Whether InOutarguments are supported in WF4.0

  1. True

  2. False


Correct Option: B

Which method in custom activity contains the execution logic

  1. Exec

  2. Execute

  3. CacheMetadata

  4. beginExec


Correct Option: B
- Hide questions