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.

451.

A single try block must be followed by which of these?

A. finally
B. catch
C. Both finally & catch
D. None of the mentioned
Answer» D. None of the mentioned
452.

Which of these clauses will be executed even if no exceptions are found?

A. throws
B. finally
C. throw
D. catch
Answer» C. throw
453.

When is no exception thrown at runtime then who will catch it?

A. CLR
B. Operating System
C. Loader
D. Compiler
Answer» B. Operating System
454.

Which of these keywords must be used to monitor exceptions?

A. try
B. finally
C. throw
D. catch
Answer» B. finally
455.

Which of these keywords is not a part of exception handling?

A. try
B. finally
C. thrown
D. catch
Answer» D. catch
456.

Select the correct statement about an Exception?

A. It occurs during loading of program
B. It occurs during Just-In-Time compilation
C. It occurs at run time
D. All of the mentioned
Answer» D. All of the mentioned
457.

Select the statements which describe the correct usage of exception handling over conventional error handling approaches?

A. As errors can be ignored but exceptions cannot be ignored
B. Exception handling allows separation of program’s logic from error handling logic making software more reliable and maintainable
C. try – catch – finally structure allows guaranteed cleanup in event of errors under all circumstances
D. All of the mentioned
Answer» E.
458.

Which of the following is the object oriented way to handle run time errors?

A. Error codes
B. HERRESULT
C. OnError
D. Exceptions
Answer» E.
459.

Which among the following is NOT an exception?

A. Stack Overflow
B. Arithmetic Overflow or underflow
C. Incorrect Arithmetic Expression
D. All of the mentioned
Answer» D. All of the mentioned
460.

Select the correct statement about properties of read and write in C#.NET?

A. A property can simultaneously be read or write only
B. A property cannot be either read only or write only
C. A write only property will only have get accessor
D. A read only property will only have get accessor
Answer» E.
461.

If the math class had add property with get accessors then which of the following statements will work correctly?

A. math m = new math(); m.add = 10;
B. math m = new math(); m.add = m.add + 20;
C. math m = new math(); int i; i = m.add;
D. math.add = 20;
Answer» D. math.add = 20;
462.

Consider a class maths and we had a property called as sum.b which is the reference to a maths object and we want the statement Console.WriteLine(b.sum)to fail.Which among the following is the correct solution to ensure this functionality?

A. Declares sum property with only get accessor
B. Declares sum property with only set accessor
C. Declares sum property with both set and get accessor
D. Declares sum property with both set, get and normal accessor
Answer» C. Declares sum property with both set and get accessor
463.

Consider a class maths and we had a property called as sum.b is a reference to a maths object and we want the statement b.sum = 10 to fail.Which of the following is the correct solution to ensure this functionality?

A. Declare sum property with both get and set accessors
B. Declare sum property with only get accessor
C. Declare sum property with get, set and normal accessors
D. None of the mentioned
Answer» D. None of the mentioned
464.

Choose the correct statements about write-only properties in C#.NET?

A. Properties which can only be set
B. Properties once set and hence values cannot be read back in nature
C. Useful for usage in classes which store sensitive information like password of a user
D. All of the mentioned
Answer» E.
465.

Select the modifiers which can be used with the properties?

A. Private
B. Public
C. Protected Internal
D. All of the mentioned
Answer» E.
466.

Where the properties can be declared?

A. Class
B. Struct
C. Interface
D. All of the mentioned
Answer» E.
467.

Choose the statements which makes use of essential properties rather than making data member public in C#.NET?

A. Properties have their own access levels like private, public, protected etc. which allows it to have better control about managing read and write properties
B. Properties give us control about what values may be assigned to a member variables of a class they represent
C. Properties consist of set accessor inside which we can validate the value before assigning it to the data variable
D. All of the mentioned
Answer» E.
468.

Choose the wrong statement about the properties used in C#.NET?

A. Each property consists of accessor as get and set
B. A property cannot be either read or write only
C. Properties can be used to store and retrieve values to and from the data members of a class
D. Properties are like actual methods which work like data members
Answer» B. A property cannot be either read or write only
469.

Choose the correct option among the following indexers which correctly allows to index in same way as an array?

A. A class
B. An interface
C. A function
D. A property
Answer» B. An interface
470.

Choose the correct alternative that utilizes the indexed property such that a group named class has indexed property which stores or retrieves value to/from an array of 5 numbers?

A. group[3] = 34;
B. group g = group();
C. Console.WriteLine(group[3]);
D. group g = new group(); Console.WriteLine(g[3]);
Answer» E.
471.

Choose the correct statement about properties describing the indexers?

A. No need to use the name of the property while using an indexed property
B. An indexer property should accept at least one argument
C. Indexers can be overloaded
D. All of the mentioned
Answer» E.
472.

Which among the following are the advantages of using indexers?

A. To use collection of items at a large scale we make use of indexers as they utilize objects of class that represent the collection as an array
B. Indexers are also convenient as they can also make use of different types of indexers like int, string etc
C. An indexer allows an object to be indexed such as an array
D. All of the mentioned
Answer» E.
473.

Choose the correct statement among the following?

A. A property can be a static member whereas an indexer is always an instance member
B. A get accessor of a property corresponds to a method with no parameters whereas get accessor of an indexer corresponds to a method with the same formal parameters lists as the indexer
C. It is an error for indexer to declare a local variable with the same name as indexer parameters
D. All of the mentioned
Answer» E.
474.

Choose the operator/operators which is/are not used to access the [] operator in indexers?

A. get
B. set
C. access
D. all of the mentioned
Answer» D. all of the mentioned
475.

Choose the keyword which declares the indexer?

A. base
B. this
C. super
D. extract
Answer» C. super
476.

Choose the correct statement among the followings?

A. Indexers are location indicators
B. Indexers are used to access class objects
C. Indexer is a form of property and works in the same way as a property
D. All of the mentioned
Answer» E.
477.

Which of these data types is used by operating system to manage the Recursion in Csharp?

A. Array
B. Queue
C. Tree
D. Stack
Answer» E.
478.

Which of these will happen if recursive method does not have a base case?

A. Infinite loop condition occurrence
B. System gets hanged
C. After 10000 executions program will be automatically stopped
D. None of the mentioned
Answer» B. System gets hanged
479.

What is Recursion in CSharp defined as?

A. Recursion is another form of class
B. Recursion is another process of defining a method that calls other methods repeatedly
C. Recursion is a process of defining a method that calls itself repeatedly
D. Recursion is a process of defining a method that calls other methods which in turn calls this method
Answer» D. Recursion is a process of defining a method that calls other methods which in turn calls this method
480.

What is vector in operator overloading?

A. class
B. method()
C. data type
D. none of the mentioned
Answer» D. none of the mentioned
481.

Choose the correct statement among the below mentioned statements:

A. Forgetting to declare an operator method as public
B. Forgetting to declare an operator method as static
C. Forgetting to return a bool type value while overloading a relational operator
D. All of the mentioned
Answer» E.
482.

Correct method to define + operator is?

A. public sample operator +(int a, int b)
B. public abstract operator +(int a, int b)
C. public static sample operator +(int a, int b)
D. public abstract sample operator +(int a, int b)
Answer» D. public abstract sample operator +(int a, int b)
483.

Which statements are correct about operator overloading?

A. Mathematical or physical modeling where we use classes to represent objects such as vectors,matrices,complex-numbers etc
B. Graphical programs where coordinate related objects are used to represent positions on the screen
C. Financial programs where a class represents an amount of money
D. All of the mentioned
Answer» E.
484.

Operators that can be overloaded are?

A. ||
B. ‘+=’
C. +
D. [].
Answer» D. [].
485.

Which of following statements are correct in nature?

A. The conditional logical operators cannot be overloaded
B. The array indexing operator can be overloaded
C. A public or nested public preference type does not overload the equality operator
D. None of the mentioned
Answer» B. The array indexing operator can be overloaded
486.

Which of the following keyword is used to overload user defined types by defining static member functions?

A. op
B. opoverload
C. operator
D. operatoroverload
Answer» D. operatoroverload
487.

Choose the wrong statement about ‘INTERFACE’ in C#.NET?

A. An explicitly implemented member could be accessed from an instance of the interface
B. Interfaces are declared public automatically
C. An interface could not contain signature of the indexer
D. None of the mentioned
Answer» D. None of the mentioned
488.

Access specifiers which can be used for an interface are?

A. Public
B. Protected
C. Private
D. All of the mentioned
Answer» B. Protected
489.

Does C#.NET support partial implementation of interfaces?

A. True
B. False
C. Can’t Say
D. None of the mentioned
Answer» C. Can’t Say
490.

Which of the following is the correct way of implementing an interface addition by class maths?

A. class maths : addition {}
B. class maths implements addition {}
C. class maths imports addition {}
D. none of the mentioned
Answer» B. class maths implements addition {}
491.

Choose the statements which makes interface different from classes?

A. Unlike classes, interfaces consists of only declaration but not implementation
B. Interfaces cannot be used directly like classes to create new objects
C. Interfaces consists of declaration of methods,properties events and type definitions
D. All of the mentioned
Answer» E.
492.

Which keyword is used for correct implementation of an interface in C#.NET?

A. interface
B. Interface
C. intf
D. Intf
Answer» B. Interface
493.

Select the correct statement among the given statements?

A. One class could implement only one interface
B. Properties could be declared inside an interface
C. Interfaces cannot be inherited
D. None of the mentioned
Answer» C. Interfaces cannot be inherited
494.

Which of the following statements correctly define about the implementation of interface?

A. The calls to implementation of interface methods are routed through a method table
B. A class which implements an interface can explicitly implement members of that interface
C. One interface can be implemented in another interface
D. None of the mentioned
Answer» B. A class which implements an interface can explicitly implement members of that interface
495.

A class consists of two interfaces with each interface consisting of three methods.The class had no instance data. Which of the following indicates the correct size of object created from this class?

A. 12 bytes
B. 16 bytes
C. 0 bytes
D. 24 bytes
Answer» E.
496.

Which of the following cannot be used to declare an interface correctly?

A. Properties
B. Methods
C. Structures
D. Events
Answer» D. Events
497.

Which statement correctly defines Interfaces in C#.NET?

A. Interfaces cannot be inherited
B. Interfaces consists of data static in nature and static methods
C. Interfaces consists of only method declaration
D. None of the mentioned
Answer» E.
498.

Which of the following modifiers is used when an abstract method is redefined by a derived class?

A. Overloads
B. Override
C. Base
D. Virtual
Answer» C. Base
499.

If a class inheriting an abstract class does not define all of its functions then it is known as?

A. Abstract
B. A simple class
C. Static class
D. None of the mentioned
Answer» B. A simple class
500.

Choose the correct statements among the following:

A. An abstract method does not have implementation
B. An abstract method can take either static or virtual modifiers
C. An abstract method can be declared only in abstract class
D. All of the mentioned
Answer» E.