[go: up one dir, main page]

0% found this document useful (0 votes)
7 views6 pages

CSharp NotAnswered

The document consists of a series of objective-type questions related to programming concepts, particularly in C#. Topics include method overriding, boxing, generic classes, exception handling, data types, file handling, collections, and class modifiers. Each question prompts the reader to select the correct answer from provided options.

Uploaded by

mototrekker1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

CSharp NotAnswered

The document consists of a series of objective-type questions related to programming concepts, particularly in C#. Topics include method overriding, boxing, generic classes, exception handling, data types, file handling, collections, and class modifiers. Each question prompts the reader to select the correct answer from provided options.

Uploaded by

mototrekker1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Structures inherit ToString from System.Object.

Why would someone override that


method within a structure?

NOTE: This is objective type question, Please click question title for correct answer.

Why should boxing be avoided?

NOTE: This is objective type question, Please click question title for correct answer.

You are creating a generic class, and you need to dispose of the generic objects. How can
you do this?

NOTE: This is objective type question, Please click question title for correct answer.

Which of the following are not examples of built-in generic types?


NOTE: This is objective type question, Please click question title for correct answer.

Which of the following statements are false?


NOTE: This is objective type question, Please click question title for correct answer.

When should you use the StringBuilder class instead of the String class?

NOTE: This is objective type question, Please click question title for correct answer.

Why should you close and dispose of resources in a Finally block instead of a Catch block?
NOTE: This is objective type question, Please click question title for correct answer.

What is the correct order for Catch clauses when handling different exception types?

NOTE: This is objective type question, Please click question title for correct answer.

You need to create a simple class or structure that contains only value types. You must create the
class or structure so that it runs as efficiently as possible. You must be able to pass the class or
structure to a procedure without concern that the procedure will modify it. Which of the
following should you create?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following is NOT Value type variable?

NOTE: This is objective type question, Please click question title for correct answer.

You pass a value-type variable into a procedure as an argument. The procedure changes
the variable; however, when the procedure returns, the variable has not changed. What
happened? (Choose one.)

NOTE: This is objective type question, Please click question title for correct answer.

An IsolatedStorageFileStream object can be used like any other FileStream object?

NOTE: This is objective type question, Please click question title for correct answer.

What methods can not be used to create a new isolatedStorageFile object?

NOTE: This is objective type question, Please click question title for correct answer.

What types of data can a GZipStream compress?

NOTE: This is objective type question, Please click question title for correct answer.

Which of the following create a FileStream for writing when you want to open an existing
file or create a new one if it doesn’t exist?

Posted by: Raja | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

How do you not force changes in a StreamWriter to be sent to the stream it is writing to?

Posted by: Raja | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.
Which methods of the FileStream class doesn't affect the Position property?

Posted by: Raja | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

Which of the following are types of changes that can be detected by the File-
SystemWatcher?

Posted by: Raja | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

Which are NOT acceptable ways to open a file for writing?

Posted by: Raja | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

With strict conversions enabled, which of the following would allow an implicit conversion?

Posted by: Raja | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

If there is no valid conversion between two types, what should you do when implementing
the IConvertible interface?

Posted by: Raja | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

What is the default modifier for class in C#?

Which type is inherited by Class by default?

Which type is inherited by Structs by default?

Which namespace is required to use Generic List?


Class A { static byte a; static short b; static char c; static int d; static long e; static string s;
Public Static Void Main(String args[]) { Console.WriteLine(a+b+c+d+e+s); } }

NOTE: This is objective type question, Please click question title for correct answer.

What is the default modifier for the class member?

Posted by: SheoNarayan | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

HashTable Class is present inside which of the following NameSpace?

NOTE: This is objective type question, Please click question title for correct answer.

Which of the following is Mutable?

Posted by: Syedshakeer | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.
Which is the Best one for using String concatenation?
NOTE: This is objective type question, Please click question title for correct answer.

An array is fixed length type that can store group of objects.

NOTE: This is objective type question, Please click question title for correct answer.

Can you store multiple datatypes in an Array?

Posted by: Syedshakeer | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

Which keyword is used to prevent one class from being inherited by another class in C#

Posted by: Syedshakeer | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.
In this Sample Code which catch block will be executed? try { int j=10; try { int i=10; j=j-i;
j=i/j; } catch(Exception ex) { throw ex; } } catch(Exception ex) { throw ex; }

Posted by: Lakhangarg | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

Which of the following class does not belong to Collection namespace ?

Posted by: Syedshakeer | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

What will be the output for the following: String str1="Hello"; String str2=str1;
str1=str1+"C#"; Console.WriteLine(str2);

Posted by: Syedshakeer | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.
In C# int Refer to?
Posted by: Lakhangarg | Show/Hide Answer
NOTE: This is objective type question, Please click question title for correct answer.

A Queue is a collection where elements are processed in

Posted by: Syedshakeer | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

The Items that is put in the Queue is Reads ?


Posted by: Syedshakeer | Show/Hide Answer
NOTE: This is objective type question, Please click question title for correct answer.

Stack is collection where elements are processed in


Posted by: Syedshakeer | Show/Hide Answer
NOTE: This is objective type question, Please click question title for correct answer.
Which namespace is used to work with RegularExpression in C#?
Posted by: Raja | Show/Hide Answer
NOTE: This is objective type question, Please click question title for correct answer.

What Will be the output of the following Code? int i = 1; int j = 1; i = i++; j = ++j;
Response.Write(i.ToString() + ":" + j.ToString());
Posted by: Lakhangarg | Show/Hide Answer
NOTE: This is objective type question, Please click question title for correct answer.
With yield break statement, control gets …
Posted by: Bhakti | Show/Hide Answer
NOTE: This is objective type question, Please click question title for correct answer.

Which method is used to return an item from the Top of the Stack?

NOTE: This is objective type question, Please click question title for correct answer.

Which method is used to reads and removes an item from the head of the Queue.

Posted by: Syedshakeer | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

Whcih method is used to add an Item on stack?

Posted by: Syedshakeer | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

Which method is used to add an Item to the end of the Queue?

Posted by: Syedshakeer | Show/Hide Answer


NOTE: This is objective type question, Please click question title for correct answer.

I need to restrict a class by creating only one object throughout the application. How can I
achieve this?

We can declare the constructor of the class as either protected or as private


int? d = 1; Type testType = d.GetType(); will result…
Posted by: Bhakti | Show/Hide Answer
NOTE: This is objective type question, Please click question title for correct answer.

Does Abstract classes contain Constructor?


Posted by: G_arora | Show/Hide Answer
NOTE: This is objective type question, Please click question title for correct answer.

You might also like