Explore topic-wise MCQs in Testing Subject.

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

1.

Select the interfaces defined by the string class?

A. IComparable
B. IComparable<string>
C. ICloneable
D. All of the mentioned
Answer» E.
2.

Select the namespace in which string class is built?

A. System.Text
B. System.Net
C. System.IO
D. None of the mentioned
Answer» B. System.Net
3.

Accessibility modifiers 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.
4.

Which of these access specifiers must be used for class so that it can be inherited by another subclass?

A. public
B. private
C. both public & private
D. none of the mentioned
Answer» B. private
5.

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

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

Which among these access specifiers should be used for main() method?

A. private
B. public
C. protected
D. none of the mentioned
Answer» C. protected
7.

Which operator is commonly used to find the size of the type of C#?

A. size()
B. sizeof(type)
C. both size() & sizeof(type)
D. none of the mentioned
Answer» C. both size() & sizeof(type)
8.

What does the following code depicts? 1. System.Nullable count; 2. bool? done;

A. Code 1 declares the objects of nullable of type Nullable defined in the System namespace
B. Code 2 declares a nullable type in much shorter and in more commonly used way using ‘?’
C. Both Code 1 declares the objects of nullable of type Nullable defined in the System namespace & Code 2 declares a nullable type in much shorter and in more commonly used way using ‘?’
D. None of the mentioned
Answer» D. None of the mentioned
9.

Choose the statement which defines the Nullable type Correctly:

A. A special version of a value type that is represented by a structure
B. A nullable type can also store the value null
C. Nullable types are objects of System.Nullable, where T must be a non nullable value type
D. All of the mentioned
Answer» E.
10.

What will be the declaration of the variable ptr as the pointer to array of 6 floats?

A. float *ptr[6].
B. float [6]*ptr
C. float(*ptr)[6].
D. float(*ptr)(6).
Answer» D. float(*ptr)(6).
11.

A structure pointer points to __________

A. first member of structure
B. first two members of structure
C. whole structure
D. only to the last member of structure
Answer» D. only to the last member of structure
12.

Among the given pointers which of following cannot be incremented?

A. int
B. char
C. float
D. void
Answer» E.
13.

Which among the following is referred as an array of pointers?

A. int *p;
B. int (*)p;
C. int p[4];
D. int*[4] p;
Answer» E.
14.

Which of the following job is done by the instruction ++*p for an integer pointer p?

A. increment value contained at address p
B. increment address contained in p
C. Both increment value contained at address p and increment address contained in p
D. neither increment value contained at address p nor increment address contained in p
Answer» B. increment address contained in p
15.

After incrementing a float pointer ptr by 1 it would be incremented by __________

A. 1 byte
B. 2 bytes
C. 3 bytes
D. 4 bytes
Answer» E.
16.

What is the size of a char pointer?

A. 1 byte
B. 2 byte
C. 3 byte
D. 4 byte
Answer» C. 3 byte
17.

Choose the correct statement among the given statements?

A. Use of return statement is necessary in every function
B. Return statement may not be followed by a parenthesis
C. A program may contain more than one return statement
D. Return statement may not return a value
Answer» B. Return statement may not be followed by a parenthesis
18.

Which among the given operators is referred to as ‘address of’ operator?

A. *
B. ^
C. &
D. ~
Answer» D. ~
19.

Fill up the blank : Pointer variable is used to hold the _________ of the variable

A. Value
B. Address
C. Value and Address
D. Name of the variable
Answer» C. Value and Address
20.

Select the type argument of open constructed type?

A. Gen<int>
B. Gen<T>
C. Gen<>
D. None of the mentioned
Answer» D. None of the mentioned
21.

Which of these is an correct way of defining generic method?

A. name(T1, T2, …, Tn) { /* … */ }
B. public name { /* … */ }
C. class name[T1, T2, …, Tn] { /* … */ }
D. name{T1, T2, …, Tn} { /* … */ }
Answer» C. class name[T1, T2, …, Tn] { /* … */ }
22.

Which of these type parameters is used for generic methods to return and accept any type of object?

A. K
B. N
C. T
D. V
Answer» D. V
23.

Which of these classes is used to create servers that listen to either local or remote client programs?

A. httpServer
B. ServerSockets
C. MimeHeader
D. HttpResponse
Answer» C. MimeHeader
24.

Choose the exceptions generated by the GetResponseStream() method defined by WebRequest:

A. ProtocolViolationException
B. ObjectDisposedException
C. IOException
D. All of the mentioned
Answer» E.
25.

Which of these classes is used for operating on the request from the client to the server?

A. http
B. httpDecoder
C. httpConnection
D. httpd
Answer» E.
26.

Select the properties related to the network errors generated by WebException:

A. response
B. get
C. set
D. none of the mentioned
Answer» B. get
27.

Choose the exceptions generated by the GetReponse() method defined by WebRequest:

A. InvalidOperationException
B. ProtocolViolationException
C. WebException
D. All of the mentioned
Answer» E.
28.

Choose the exceptions generated by the Create() method defined by WebRequest:

A. NotSupportedException
B. UriFormatException
C. System.Security.SecurityException
D. All of the mentioned
Answer» E.
29.

What exception is thrown if the user does not have a proper authorization?

A. URLNotFound
B. URLSourceNotFound
C. URLSourceNotFound
D. All of the mentioned
Answer» D. All of the mentioned
30.

What exception is thrown if the protocol supported by URI prefix is invalid?

A. URLNotFound
B. URLSourceNotFound
C. UriFormatException
D. NotSupportedException
Answer» E.
31.

What exception is thrown if the URI format is invalid?

A. URLNotFound
B. URLSourceNotFound
C. MalformedURLException
D. UriFormatException
Answer» E.
32.

Which of these classes is used to access actual bits or content information of a URL?

A. URL
B. URLDecoder
C. URLConnection
D. All of the mentioned
Answer» E.
33.

Which of these data members of HttpResponse class is used to store the response from a http server?

A. status
B. address
C. statusResponse
D. statusCode
Answer» E.
34.

Which of these classes is used to encapsulate IP address and DNS?

A. DatagramPacket
B. URL
C. InetAddress
D. ContentHandler
Answer» D. ContentHandler
35.

Which of these exceptions is thrown by the URL class’s constructors?

A. URLNotFound
B. URLSourceNotFound
C. MalformedURLException
D. URLNotFoundException
Answer» D. URLNotFoundException
36.

What is the full form of URL in C#.Net?

A. Uniform Resource Locator
B. Uniform Resource Latch
C. Universal Resource Locator
D. Universal Resource Latch
Answer» B. Uniform Resource Latch
37.

Which of the following are the protocols defined by .NET runtime:

A. HTTP
B. HTTPS
C. File
D. All of the mentioned
Answer» E.
38.

Which of the following classes is used to encapsulate IP address and DNS?

A. DatagramPacket
B. URL
C. InetAddress
D. ContentHandler
Answer» D. ContentHandler
39.

Which of the following is the full form of DNS?

A. Data Network Service
B. Data Name Service
C. Domain Network Service
D. Domain Name Service
Answer» E.
40.

How many bits are present in a single IP address?

A. 8
B. 16
C. 32
D. 64
Answer» D. 64
41.

How many ports of TCP/IP are reserved for specific protocols?

A. 10
B. 1024
C. 2048
D. 512
Answer» C. 2048
42.

Which of the following class/classes supports the task of uploading and downloading the file:

A. WebRequest
B. WebResponse
C. WebClient
D. All of the mentioned
Answer» D. All of the mentioned
43.

Which of the following are the classes that support the standard HTTP protocol

A. HttpWebRequest
B. HttpResponseHeader
C. HttpRequestHeader
D. HttpStatusCode
Answer» B. HttpResponseHeader
44.

Which of the following are the interfaces defined by the namespace System.Net:

A. IAuthenticationModule
B. HttpWebRequest
C. WebProxy
D. HttpResponseHeader
Answer» B. HttpWebRequest
45.

Which of the following are the classes defined by the namespace System.Net:

A. Cookie
B. CookieContainer
C. FileWebRequest
D. All of the mentioned
Answer» E.
46.

Which namespace is mostly preferred for the operation of networking in C#?

A. System.Web
B. System.in
C. System.Net.Mail
D. All of the mentioned
Answer» D. All of the mentioned
47.

Which of these methods is executed first before execution of any other thing that takes place in a program?

A. main method
B. finalize method
C. static method
D. private method
Answer» D. private method
48.

What is the process of defining more than one method in a class differentiated by parameters known as?

A. Function overriding
B. Function overloading
C. Function doubling
D. None of the mentioned
Answer» C. Function doubling
49.

Which of these data types can be used for a method having a return statement in it?

A. void
B. int
C. float
D. all of the mentioned
Answer» E.
50.

Which among the following is not a preprocessor directive?

A. #ifdef
B. #pragma
C. #Or
D. #undef
Answer» D. #undef