

MCQOPTIONS
Saved Bookmarks
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.
551. |
How is a string typically processed? |
A. | On a character by character basis |
B. | On a string by string basis |
C. | Both On a character by character basis & On a string by string basis |
D. | None of the mentioned |
Answer» B. On a string by string basis | |
552. |
Which of these methods of class String is used to extract all the characters from a String object? |
A. | CHARAT() |
B. | Remove() |
C. | charAt() |
D. | Replace() |
Answer» C. charAt() | |
553. |
Which of these methods of the class String is used to obtain length of String object? |
A. | get() |
B. | Sizeof() |
C. | lengthof() |
D. | length() |
Answer» E. | |
554. |
Which of these methods of class are used to remove the leading and backward whitespaces? |
A. | startsWith() |
B. | trim() |
C. | Trim() |
D. | doTrim() |
Answer» D. doTrim() | |
555. |
Which of these methods of class String is used to separate a substring from a String object? |
A. | substring() |
B. | Substring() |
C. | SubString() |
D. | None of the mentioned |
Answer» C. SubString() | |
556. |
Which of these data type values is returned by equals() method of String class? |
A. | char |
B. | int |
C. | boolean |
D. | all of the mentioned |
Answer» D. all of the mentioned | |
557. |
Which of these methods returns the string such that some characters which are specified to be removed from the end of strings are removed from string by mentioning the number of characters to be removed? |
A. | Trim() |
B. | Remove() |
C. | TrimEnd() |
D. | Split() |
Answer» B. Remove() | |
558. |
Which of these methods of class String is used to check whether a substring exists at the beginning of the particular string? |
A. | StartsWith() |
B. | EndsWith() |
C. | Starts() |
D. | ends() |
Answer» B. EndsWith() | |
559. |
Which of these methods is used to compare two strings such that after comparison output returns different integer values as ( 0 for false, 1 for true)? |
A. | Equals () |
B. | Equals () |
C. | Compare() |
D. | None of the mentioned |
Answer» D. None of the mentioned | |
560. |
Which of these methods of class String is used to compare two String objects for their equality? |
A. | equals() |
B. | Equals() |
C. | isequal() |
D. | Isequal() |
Answer» B. Equals() | |
561. |
Correct way to convert a string to uppercase using string class method()? |
A. | Upper() |
B. | ToUpper() |
C. | Object.ToUpper() |
D. | None of the mentioned |
Answer» D. None of the mentioned | |
562. |
To perform comparison operation on strings supported operations are : |
A. | Compare() |
B. | Equals() |
C. | Assignment ‘==’ operator |
D. | All of the mentioned |
Answer» E. | |
563. |
What does the term ‘immutable’ means in term of string objects? |
A. | We can modify characters included in the string |
B. | We cannot modify characters contained in the string |
C. | We cannot perform various operation of comparison,inserting,appending etc |
D. | None of the mentioned |
Answer» C. We cannot perform various operation of comparison,inserting,appending etc | |
564. |
What is the String in C# meant for? |
A. | Variable |
B. | Character Array |
C. | Object |
D. | Class |
Answer» D. Class | |
565. |
Which of the following statement is correct about a string in C#.NET? |
A. | The System.Array class is used to represent a string |
B. | A string has a zero-based index |
C. | A number cannot be represented in the form of a string |
D. | A string is mutable because it can be modified once it has been created |
Answer» C. A number cannot be represented in the form of a string | |
566. |
Select wrong statement about destructor in C#? |
A. | A class can have one destructor only |
B. | Destructors cannot be inherited or overloaded |
C. | Destructors can have modifiers or parameters |
D. | All of the mentioned |
Answer» D. All of the mentioned | |
567. |
Operator used to free the memory when memory is allocated ? |
A. | new |
B. | free |
C. | delete |
D. | none of the mentioned |
Answer» D. none of the mentioned | |
568. |
Which of the following statements are correct? |
A. | There is one garbage collector per program running in memory |
B. | There is one common garbage collector for all programs |
C. | To garbage collect an object set all references to it as null |
D. | Both There is one common garbage collector for all programs & To garbage collect an object set all references to it as null |
Answer» E. | |
569. |
Name a method which has the same name as that of class and which is used to destroy objects also called automatically when application is finally on process of being getting terminated. |
A. | Constructor |
B. | Finalize() |
C. | Destructor |
D. | End |
Answer» D. End | |
570. |
The method called by clients of a class to explicitly release any resources like network,connection,open files etc.When the object is no longer required? |
A. | Finalize() |
B. | End() |
C. | Dispose() |
D. | Close() |
Answer» D. Close() | |
571. |
Which operator among the following signifies the destructor operator? |
A. | :: |
B. | : |
C. | ~ |
D. | & |
Answer» D. & | |
572. |
Which method has the same name as that of its class? |
A. | delete |
B. | class |
C. | constructor |
D. | none of mentioned |
Answer» D. none of mentioned | |
573. |
What is the return type of constructors? |
A. | int |
B. | float |
C. | void |
D. | none of the mentioned |
Answer» E. | |
574. |
Which among the following is the correct statement: Constructors are used to |
A. | initialize the objects |
B. | construct the data members |
C. | initialize the objects & construct the data members |
D. | None of the mentioned |
Answer» B. construct the data members | |
575. |
Correct statement about constructors in C#.NET is ? |
A. | Constructors can be overloaded |
B. | Constructors are never called explicitly |
C. | Constructors have same name as name of the class |
D. | All of the mentioned |
Answer» E. | |
576. |
Number of constructors a class can define is ? |
A. | 1 |
B. | 2 |
C. | Any number |
D. | None of the mentioned |
Answer» D. None of the mentioned | |
577. |
How many values does a function return? |
A. | 0 |
B. | 2 |
C. | 1 |
D. | any number of values |
Answer» D. any number of values | |
578. |
Which of following statements are correct about functions? |
A. | C# allows a function to have arguments with default values |
B. | Redefining a method parameter in the method’s body causes an exception |
C. | C# allows function to have arguments with default values |
D. | Omitting the return type in method definition results into exception |
Answer» B. Redefining a method parameter in the method’s body causes an exception | |
579. |
Select correct differences between ‘=’ and ‘==’ in C#. |
A. | ‘==’ operator is used to assign values from one variable to another variable ‘=’ operator is used to compare value between two variables |
B. | ‘=’ operator is used to assign values from one variable to another variable ‘==’ operator is used to compare value between two variables |
C. | No difference between both operators |
D. | None of the mentioned |
Answer» C. No difference between both operators | |
580. |
Which reference modifier is used to define reference variable? |
A. | & |
B. | ref |
C. | # |
D. | $ |
Answer» C. # | |
581. |
The data members of a class by default are ? |
A. | protected, public |
B. | private, public |
C. | private |
D. | public |
Answer» D. public | |
582. |
“A mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse.In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data.” |
A. | Abstraction |
B. | Polymorphism |
C. | Inheritance |
D. | Encapsulation |
Answer» E. | |
583. |
Which of following statements about objects in “C#” is correct? |
A. | Everything you use in C# is an object, including Windows Forms and controls |
B. | Objects have methods and events that allow them to perform actions |
C. | All objects created from a class will occupy equal number of bytes in memory |
D. | All of the mentioned |
Answer» E. | |
584. |
What is the most specified using class declaration ? |
A. | type |
B. | scope |
C. | type & scope |
D. | None of mentioned |
Answer» D. None of mentioned | |
585. |
The operator used to access member function of a class? |
A. | : |
B. | :: |
C. | . |
D. | # |
Answer» D. # | |
586. |
Which of the following is used to define the member of a class externally? |
A. | : |
B. | :: |
C. | # |
D. | none of the mentioned |
Answer» C. # | |
587. |
Which among the following is a conditional operator ? |
A. | ‘:?’ |
B. | ?; |
C. | ?: |
D. | ?? |
Answer» D. ?? | |
588. |
Which of the following options is not a Bitwise Operator in C#? |
A. | &, | |
B. | ^, ~ |
C. | <<, >> |
D. | +=, -= |
Answer» E. | |
589. |
Which of the following is/are not Relational operators in C#.NET ? |
A. | >= |
B. | <>= |
C. | Not |
D. | <= |
Answer» C. Not | |
590. |
The correct way of incrementing the operators are : |
A. | ++ a ++ |
B. | b ++ 1 |
C. | c += 1 |
D. | d =+ 1 |
Answer» D. d =+ 1 | |
591. |
Disadvantages of Explicit Conversion are? |
A. | Makes program memory heavier |
B. | Results in loss of data |
C. | Potentially Unsafe |
D. | None of the mentioned |
Answer» C. Potentially Unsafe | |
592. |
Type of Conversion in which compiler is unable to convert the data type implicitly is? |
A. | ushort to long |
B. | int to uint |
C. | ushort to long |
D. | byte to decimal |
Answer» C. ushort to long | |
593. |
The subset of ‘int’ data type is : |
A. | long ,ulong, ushort |
B. | long, ulong, uint |
C. | long, float, double |
D. | long, float, ushort |
Answer» D. long, float, ushort | |
594. |
Implicit Conversion’ follows the order of conversion as per compatibility of data type as : |
A. | float < char < int |
B. | char < int < float |
C. | int < char < float |
D. | float < int < char |
Answer» C. int < char < float | |
595. |
Types of ‘Data Conversion’ in C#? |
A. | Implicit Conversion |
B. | Explicit Conversion |
C. | Implicit Conversion and Explicit Conversion |
D. | None of the mentioned |
Answer» C. Implicit Conversion and Explicit Conversion | |
596. |
What is the need for ‘Conversion of data type’ in C#? |
A. | To store a value of one data type into a variable of another data type |
B. | To get desired data |
C. | To prevent situations of runtime error during change or conversion of data type |
D. | None of the mentioned |
Answer» D. None of the mentioned | |
597. |
Select differences between reference type and value type : 1. Memory allocated to ‘Value type’ is from heap and reference type is from ‘System. ValueType’ 2. Memory allocated to ‘Value type’ is from ‘System. ValueType’ and reference type is from ‘Heap’ 3. Structures, enumerated types derived from ‘System. ValueType’ are created on stack, hence known as ValueType and all ‘classes’ are reference type because values are stored on heap |
A. | 1, 3 |
B. | 2, 3 |
C. | 1, 2, 3 |
D. | 1 |
Answer» C. 1, 2, 3 | |
598. |
Choose effective differences between ‘Boxing’ and ‘Unboxing’. |
A. | ‘Boxing’ is the process of converting a value type to the reference type and ‘Unboxing’ is the process of converting reference to value type |
B. | Boxing’ is the process of converting a reference type to value type and ‘Unboxing’ is the process of converting value type to reference type |
C. | In ‘Boxing’ we need explicit conversion and in ‘Unboxing’ we need implicit conversion |
D. | Both ‘Boxing’ and ‘Unboxing’ we need implicit conversion |
Answer» B. Boxing’ is the process of converting a reference type to value type and ‘Unboxing’ is the process of converting value type to reference type | |
599. |
Scope of variable is related to definition of variable as: 1. Region of code within which variable value is valid and hence can be accessed. 2. No, relation with region where variable is declared its value is valid in entire scope. |
A. | a |
B. | b |
C. | a, b |
D. | None of the mentioned |
Answer» B. b | |
600. |
DIFFERENCE BETWEEN KEYWORDS ‘VAR’ AND ‘DYNAMIC’ ? |
A. | ‘Var’ is introduced in C# (3.0) and ‘Dynamic’ is introduced in C# (4.0) |
B. | ‘Var’ is a type of variable where declaration is done at compile time by compiler while ‘Dynamic’ declaration is achieved at runtime by compiler |
C. | For ‘Var’ Error is caught at compile time and for ‘Dynamic’ Error is caught at runtime |
D. | All of the mentioned |
Answer» E. | |