0

programming languages Online Quiz - 38

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

Which version of the .NET Framework introduced WPF?

  1. 1.1

  2. 2.0

  3. 3.0

  4. 3.5

  5. 4.0


Correct Option: C

How can a class be both abstract and sealed?

  1. The class has no public constructors.

  2. The class is static.

  3. The class implements more than one interface.

  4. The class is generic.

  5. This scenario is impossible.


Correct Option: B

Which of the following technologies does NOT support some form of declarative data binding?

  1. WPF

  2. Windows Forms

  3. ASP.NET

  4. XAML

  5. Silverlight


Correct Option: B

True or False: It is impossible to access a MySQL database using C# code.

  1. True

  2. False


Correct Option: B

Which of the following is not a real namespace in the .NET Framework?

  1. System

  2. System.Windows

  3. System.Windows.Presentation

  4. System.Windows.Media

  5. System.Windows.Zaml


Correct Option: E

How do you get help about the command "cp"?

  1. help cp

  2. man cp

  3. cp ?

  4. ? cp


Correct Option: B

How do you list all the files that are in the current directory?

  1. list all

  2. ls -full

  3. ls -a

  4. ls -all


Correct Option: C

How do you rename file "new" in file "old"?

  1. mv new old

  2. cp new old

  3. rn new old

  4. rename new old


Correct Option: A

How do you visualize the content of file "not_empty"?

  1. type not_empty

  2. cat not_empty

  3. more not_empty

  4. view not_empty


Correct Option: B

How do you create a new directory called "flower"?

  1. newdir flower

  2. mkdir flower

  3. crdir flower

  4. create flower


Correct Option: B

The following statement is valid. double price = 7,450.98

  1. True

  2. False


Correct Option: B

Which of the following are storage qualifiers in C++ ?

  1. const

  2. volatile

  3. mutable

  4. All the Above

  5. None of the Above


Correct Option: D

Which of the following exists in C++?

  1. virtual destructor

  2. virtual constructor

  3. Both A and B

  4. None of the Above


Correct Option: A

AI Explanation

To answer this question, you need to understand the concept of virtual functions in C++.

In C++, virtual functions are used to achieve runtime polymorphism. When a base class pointer points to a derived class object, and a virtual function is called using that pointer, the function in the derived class gets executed instead of the base class. This allows for dynamic binding of the function call based on the actual type of the object being pointed to.

Now, let's go through each option to understand why it is correct or incorrect:

Option A) virtual destructor - This option is correct. In C++, a virtual destructor is used to ensure that the destructor of the most derived class is called when deleting an object through a base class pointer. This is important when dealing with polymorphic objects to ensure that all resources are properly deallocated.

Option B) virtual constructor - This option is incorrect. In C++, constructors cannot be virtual. The constructor of a class is called automatically when an object is created, and it is determined statically at compile-time based on the type of the object being created.

Option C) Both A and B - This option is incorrect because option B is incorrect. Only option A, virtual destructor, exists in C++.

Option D) None of the Above - This option is incorrect. As explained above, option A, virtual destructor, exists in C++.

The correct answer is A) virtual destructor. This option is correct because a virtual destructor is used in C++ to ensure proper cleanup of resources when deleting objects through base class pointers.

A template can be instantiated by

  1. Explicit Instantiation

  2. Implicit instantiation

  3. Both A and B

  4. None of the Above


Correct Option: C
  1. Extraction Operator

  2. Insertion Operator

  3. Scope resolution operator

  4. None of the Above


Correct Option: C
  1. call by value

  2. call by reference

  3. call by address

  4. All the Above


Correct Option: B
- Hide questions