Explore topic-wise MCQs in Technical Programming.

This section includes 623 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.

501.

The modifier used to define a class which does not have objects of its own but acts as a base class for its subclass is?

A. Sealed
B. Static
C. New
D. Abstract
Answer» E.
502.

A type of class which does not have its own objects but acts as a base class for its subclass is known as?

A. Static class
B. Sealed class
C. Abstract class
D. None of the mentioned
Answer» D. None of the mentioned
503.

Correct statement about constructor overloading in C# is?

A. Overloaded constructors have the same name as the class
B. Overloaded constructors cannot use optional arguments
C. Overloaded constructors can have different type of number of arguments as well as differ in number of arguments
D. All of the mentioned
Answer» D. All of the mentioned
504.

When we call a constructor method among different given constructors. We match the suitable constructor by matching the name of constructor first , then the number and then the type of parameters to decide which constructor is to be overloaded.The process is also known as?

A. Method overriding
B. Inheritance
C. Polymorphism
D. Encapsulation
Answer» D. Encapsulation
505.

Which keyword is used to refer baseclass constructor to subclass constructor?

A. This
B. Static
C. Base
D. Extend
Answer» D. Extend
506.

To override a method in the subclass, the base class method should be defined as?

A. Virtual
B. Abstract
C. Override
D. All of the mentioned.
Answer» E.
507.

Which of the following cannot be used to declare a class as a virtual?

A. Methods
B. Properties
C. Events
D. Fields
Answer» E.
508.

Select the correct statement from the following?

A. Static methods can be a virtual method
B. Abstract methods can be a virtual method
C. When overriding a method, the names and type signatures of the override method must be the same as the virtual method that is being overridden
D. We can override virtual as well as nonvirtual methods
Answer» D. We can override virtual as well as nonvirtual methods
509.

Which of the given modifiers can be used to prevent Method overriding?

A. Static
B. Constant
C. Sealed
D. final
Answer» D. final
510.

The process of defining a method in a subclass having same name & type signature as a method in its superclass is known as?

A. Method overloading
B. Method overriding
C. Method hiding
D. None of the mentioned
Answer» C. Method hiding
511.

Which keyword is used to declare a base class method while performing overriding of base class methods?

A. this
B. virtual
C. override
D. extend
Answer» C. override
512.

The process of defining two or more methods within the same class that have same name but different parameters list?

A. Method overloading
B. Method overriding
C. Encapsulation
D. None of the mentioned
Answer» B. Method overriding
513.

Which of these operators must be used to inherit a class?

A. :
B. &
C. ::
D. extends
Answer» B. &
514.

Which of these keywords is used to refer to member of base class from a sub class?

A. upper
B. base
C. this
D. None of the mentioned
Answer» C. this
515.

Which statements are correct?

A. If a base class consists of a member function fun() and a derived class do not have any function with this name. An object of derived class can access fun()
B. A class D can be derived from class C, which is derived from class B which in turn is derived from class A
C. If a base class and a derived class each include a member function with same name,the member function of the derived class will be called by object of derived class
D. All of the mentioned
Answer» E.
516.

Which statements among following are correct?

A. We can derive a class from a base class even if source code of base class not available
B. Multiple inheritance is different from multiple levels of inheritance
C. It is legal to make objects of one class as members of another class
D. All of the mentioned
Answer» E.
517.

Which of the following functionality is facilitated by inheritance mechanism?

A. Use the existing functionality of base class
B. Override the existing functionality of base class
C. Implements new functionality in derived class
D. All of the mentioned
Answer» E.
518.

A class member declared protected becomes member of subclass of which type?

A. public member
B. private member
C. protected member
D. static member
Answer» E.
519.

Wrong statement about inheritance in C# .NET?

A. In inheritance chain, object construction begins from base class towards derived class
B. Inheritance cannot extend base class functionality
C. A derived class object contains all base class data
D. All of the mentioned
Answer» C. A derived class object contains all base class data
520.

In Inheritance concept, which of the following members of base class are accessible to derived class members?

A. static
B. protected
C. private
D. shared
Answer» C. private
521.

Select the class visibility modifiers among the following :

A. Private, protected, public, internal
B. Private, protected, public, internal, protected internal
C. Private, protected, public
D. All of the mentioned
Answer» C. Private, protected, public
522.

In an inheritance chain through which of following, the base class and its components are accessible to the derived class?

A. Scope resolution operator(:)
B. Class visibility modifiers (public,private etc.)
C. Dot operator (.)
D. All of the mentioned
Answer» C. Dot operator (.)
523.

The number of levels of inheritance are?

A. 5
B. 4
C. 3
D. 2
Answer» C. 3
524.

Which procedure among the following should be used to implement a ‘Has a’ or a ‘Kind of’ relationship between two entities?

A. Polymorphism
B. Inheritance
C. Templates
D. All of the mentioned
Answer» C. Templates
525.

Which among the following differentiates enum in C#.NET from enum in C language?

A. C is strictly a typed language, C#.NET also is a strictly typed language
B. In C, language variables of enum types can be used interchangeably with integers using type casts while enum variables cannot be used as a normal integers in C#.NET
C. None of the mentioned
D. All of the mentioned
Answer» C. None of the mentioned
526.

Choose the correct statement about enum used in C#.NET ?

A. By default the first enumerator has a value equal to the number of elements present in the list
B. Values of the enum elements cannot be populated from database
C. The value of each successive enumerator is decreased by 1
D. An enumerator has a white space in its name
Answer» C. The value of each successive enumerator is decreased by 1
527.

Wrong statement about enum used in C#.NET is?

A. An enum can be declared inside a class
B. An object cannot be assigned to an enum variable
C. An enum can be declared outside a class
D. An enum can have Single and Double values
Answer» E.
528.

Which among the following cannot be used as a datatype for an enum in C#.NET?

A. short
B. double
C. int
D. all of the mentioned
Answer» C. int
529.

Choose the correct statements about enum used in C#.NET?

A. An enum variable cannot have a private access modifier
B. An enum variable can be defined inside a class or a namespace
C. An enum variable cannot have a protected access modifier
D. An enum variable cannot have a public access modifier
Answer» D. An enum variable cannot have a public access modifier
530.

Select the wrong statements among the following?

A. A structure can contain properties
B. A structure can contain constructors
C. A structure can contain protected data members
D. A structure can contain constants
Answer» D. A structure can contain constants
531.

When does a structure variable get destroyed?

A. When no reference refers to it,it will get garbage collected
B. Depends on whether it is created using new or without new operator
C. As variable goes out of the scope
D. Depends on either we free its memory using free() or delete()
Answer» D. Depends on either we free its memory using free() or delete()
532.

Choose the wrong statement about structures in C#.NET?

A. Structures can be declared within a procedure
B. Structures can implement an interface but they cannot inherit from another structure
C. Structure members cannot be declared as protected
D. A structure cannot be empty
Answer» B. Structures can implement an interface but they cannot inherit from another structure
533.

Choose the correct statement about structures as to why they are defined as value types but not reference types?

A. Since space required for structure variables is allocated on stack which is a form of memory that is automatically available when a variable to be used is in scope
B. Structures generally are used to represent user defined data types that consists of small amount of data in them.Hence using stack for declaration of such variables is not a problem.
C. All of the mentioned
D. None of the mentioned
Answer» D. None of the mentioned
534.

Choose the correct statement among the following which supports the fact that C# does not allow the creation of empty structures?

A. C#.NET supports creation of abstract user-defined data types using structures
B. By having empty structures,it would mean that the new data types have no data associated with, which does not make any sense in C#.NET
C. Basic reason to create structures is the inability to represent real life objects using standard data types offered by the language
D. All of the mentioned
Answer» E.
535.

Wrong statement about run time polymorphism is?

A. The overridden base method should be virtual,abstract or override
B. An abstract method is implicitly a virtual method
C. An abstract inherited property cannot be overridden in a derived class
D. Both override method and virtual method must have same access level modifie
Answer» D. Both override method and virtual method must have same access level modifie
536.

Selecting appropriate method out of number of overloaded methods by matching arguments in terms of number ,type and order and binding that selected method to object at compile time is called?

A. Static binding
B. Static Linking
C. Compile time polymorphism
D. All of the mentioned
Answer» E.
537.

Correct way to overload +operator?

A. public sample operator + ( sample a, sample b)
B. public abstract operator + (sample a,sample b)
C. public static sample operator + (sample a, sample b)
D. All of the mentioned
Answer» E.
538.

Which of the following keyword is used to change data and behavior of a base class by replacing a member of the base class with a new derived member?

A. Overloads
B. Overrides
C. new
D. base
Answer» D. base
539.

The capability of an object in Csharp to take number of different forms and hence display behaviour as according is known as:

A. Encapsulation
B. Polymorphism
C. Abstraction
D. None of the mentioned
Answer» C. Abstraction
540.

The modifiers used to define an array of parameters or list of arguments:

A. ref
B. out
C. param
D. var
Answer» D. var
541.

The method in which large or variable number of arguments are handled is known as:

A. Value parameters
B. Output parameters
C. Parameter arrays
D. None of the mentioned
Answer» D. None of the mentioned
542.

Which statement is/are correct?

A. An argument passed to a ref parameter need not to be initialized first
B. Variables passed as out arguments need to be initialized prior to being passed
C. To use a ref parameter, only the calling method must explicitly use the ref keyword
D. None of the mentioned
Answer» E.
543.

Statements about ‘ref’ keyword used in C#.NET are?

A. The ref keyword causes arguments to be passed by reference
B. While using ‘ref’ keyword any changes made to the parameter in the method will be reflected in the variable when control is passed back to the calling method
C. Ref usage eliminates overhead of copying large data items
D. All of the mentioned
Answer» E.
544.

Choose the statements which are false in nature:

A. The base class member functions can access public member functions of derived class
B. An object of a derived class cannot access private member of the base class
C. Private members of the base class cannot be accessed by derived class member functions or objects of derived class
D. None of the mentioned
Answer» B. An object of a derived class cannot access private member of the base class
545.

Accessibility modifier defined in a class are?

A. public, private, protected
B. public, internal, protected internal.
C. public, private, internal, protected internal.
D. public, private, protected, internal, protected internal
Answer» E.
546.

What is the process by which we can control parts of a program that can access the members of a class?

A. Polymorphism
B. Abstraction
C. Encapsulation
D. Recursion
Answer» D. Recursion
547.

Which of these base classes are accessible to the derived class members?

A. static
B. protected
C. private
D. Shared
Answer» C. private
548.

Which of these is used to access members of class before the object of that class is created?

A. public
B. private
C. static
D. protected
Answer» D. protected
549.

Which of these is used as a default specifier for a member of the class if no access specifier is used for it?

A. private
B. public
C. public, within its own class
D. protected
Answer» B. public
550.

How to print \\ on the screen?

A. Console.WriteLine(“”);
B. Console.WriteLine(“”);
C. Console.WriteLine(“”);
D. Console.WriteLine(“”);
Answer» D. Console.WriteLine(“”);