0% found this document useful (0 votes)
19 views47 pages

150+ C# MCQ

The document provides a list of various projects related to Spring Boot, React JS, and MySQL, along with their corresponding YouTube links. It also includes a series of questions and answers regarding the .NET framework and C# programming concepts. Additionally, it promotes a premium subscription for notes and materials, and encourages joining a community for updates.

Uploaded by

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

150+ C# MCQ

The document provides a list of various projects related to Spring Boot, React JS, and MySQL, along with their corresponding YouTube links. It also includes a series of questions and answers regarding the .NET framework and C# programming concepts. Additionally, it promotes a premium subscription for notes and materials, and encourages joining a community for updates.

Uploaded by

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

Explore More

Subcription : Premium CDAC NOTES & MATERIAL @99

Contact to Join Click to Join


Premium Group Telegram Group

For More E-Notes


Join Our Community to stay Updated

TAP ON THE ICONS TO JOIN!


Project List

pg. 1 contact us on 8007592194 / 9284926333 www.codewitharrays.in


Project List

pg. 2 contact us on 8007592194 / 9284926333 www.codewitharrays.in


Project List

pg. 3 contact us on 8007592194 / 9284926333 www.codewitharrays.in


Project List

Spring Boot + React JS + MySQL Project List


Sr.No Project Name YouTube Link
1 Online E-Learning Hub Platform Project https://youtu.be/KMjyBaWmgzg?si=YckHuNzs7eC84-IW
2 PG Mate / Room sharing/Flat sharing https://youtu.be/4P9cIHg3wvk?si=4uEsi0962CG6Xodp
3 Tour and Travel System Project Version 1.0 https://youtu.be/-UHOBywHaP8?si=KHHfE_A0uv725f12
4 Marriage Hall Booking https://youtu.be/VXz0kZQi5to?si=llOS-QG3TpAFP5k7
5 Ecommerce Shopping project https://youtu.be/vJ_C6LkhrZ0?si=YhcBylSErvdn7paq
6 Bike Rental System Project https://youtu.be/FIzsAmIBCbk?si=7ujQTJqEgkQ8ju2H
7 Multi-Restaurant management system https://youtu.be/pvV-pM2Jf3s?si=PgvnT-yFc8ktrDxB
8 Hospital management system Project https://youtu.be/IynIouBZvY4?si=CXzQs3BsRkjKhZCw
9 Municipal Corporation system Project https://youtu.be/cVMx9NVyI4I?si=qX0oQt-GT-LR_5jF
10 Tour and Travel System Project version 2.0 https://youtu.be/_4u0mB9mHXE?si=gDiAhKBowi2gNUKZ

Sr.No
Project Name YouTube Link
11 Tour and Travel System Project version 3.0 https://youtu.be/Dm7nOdpasWg?si=P_Lh2gcOFhlyudug
12 Gym Management system Project https://youtu.be/J8_7Zrkg7ag?si=LcxV51ynfUB7OptX
13 Online Driving License system Project https://youtu.be/3yRzsMs8TLE?si=JRI_z4FDx4Gmt7fn
14 Online Flight Booking system Project https://youtu.be/m755rOwdk8U?si=HURvAY2VnizIyJlh
15 Employee management system project https://youtu.be/lD1iE3W_GRw?si=Y_jv1xV_BljhrD0H
16 Online student school or college portal https://youtu.be/4A25aEKfei0?si=RoVgZtxMk9TPdQvD
17 Online movie booking system project https://youtu.be/Lfjv_U74SC4?si=fiDvrhhrjb4KSlSm
18 Online Pizza Delivery system project https://youtu.be/Tp3izreZ458?si=8eWAOzA8SVdNwlyM
19 Online Crime Reporting system Project https://youtu.be/0UlzReSk9tQ?si=6vN0e70TVY1GOwPO
20 Online Children Adoption Project https://youtu.be/3T5HC2HKyT4?si=bntP78niYH802I7N
pg. 4 contact us on 8007592194 / 9284926333 www.codewitharrays.in
Chapter: Unit 1

1. Which of the following statements are TRUE about the .NET CLR?
1. It provides a language-neutral development & execution environment.
2. It ensures that an application would not be able to access memory that it is not authorized to access.
3. It provides services to run "managed" applications.
4. The resources are garbage collected.
5. It provides services to run "unmanaged" applications.

A. Only 1 and 2

B. Only 1,2 and 4

C. 1,2,3,4

D. Only 4 and 5

Answer» C. 1,2,3,4
discuss

2. Which of the following are valid .NET CLR JIT performance counters?
1. Total memory used for JIT compilation
2. Average memory used for JIT compilation
3. Number of methods that failed to compile with the standard JIT
4. Percentage of processor time spent performing JIT compilation
5. Percentage of memory currently dedicated for JIT compilation

A. 1,5

B. 3,4

C. 1,2

D. 4,5

Answer» B. 3,4
discuss

3. Which of the following statements is correct about Managed Code?

A. Managed code is the code that is compiled by the JIT compilers.

B. Managed code is the code where resources are Garbage Collected.

C. Managed code is the code that runs on top of Windows.

D. Managed code is the code that is written to target the services of the CLR.

Answer» D. Managed code is the code that is written to target the services of the CLR.
discuss
4. Which of the following are NOT true about .NET Framework?
1. It provides a consistent object-oriented programming environment whether object code is stored and
executed locally, executed locally but Internet-distributed, or executed remotely.
2. It provides a code-execution environment that minimizes software deployment and versioning conflicts.
3. It provides a code-execution environment that promotes safe execution of code, including code created
by an unknown or semi-trusted third party.
4. It provides different programming models for Windows-based applications and Web-based applications.
5. It provides an event driven programming model for building Windows Device Drivers.

A. 1,2

B. 2,4

C. 4,5

D. 1,2,4

Answer» C. 4,5
discuss

5. Which of the following components of the .NET framework provide an extensible set of classes that can be
used by any .NET compliant programming language?

A. NET class libraries

B. Common Language Runtime

C. Common Language Infrastructure

D. Component Object Model

Answer» A. NET class libraries


discuss

6. Which of the following .NET components can be used to remove unused references from the managed
heap?

A. Common Language Infrastructure

B. CLR

C. Garbage Collector

D. Class Loader

Answer» C. Garbage Collector


discuss

7. Which of the following statements correctly define .NET Framework?

It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and Web
A.
Services

B. It is an environment for developing, building, deploying and executing only Web Applications.

Answer» A. It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and
Web Services
7. Which of the following statements correctly define .NET Framework?

C. It is an environment for developing, building, deploying and executing Distributed Applications.

D. It is an environment for developing, building, deploying and executing Web Services.

Answer» A. It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and
Web Services
discuss

8. Which of the following constitutes the .NET Framework?


1. ASP.NET Applications
2. CLR
3. Framework Class Library
4. WinForm Applications
5. Windows Services

A. 1,2

B. 2,3

C. 3,4

D. 2,5

Answer» B. 2,3
discuss

9. Which of the following assemblies can be stored in Global Assembly Cache?

A. Private Assemblies

B. Friend Assemblies

C. Shared Assemblies

D. Public Assemblies

Answer» C. Shared Assemblies


discuss

10. Code that targets the Common Language Runtime is known as

A. Unmanaged

B. Distributed

C. Legacy

D. Managed code

Answer» D. Managed code


discuss
11. Which of the following statements is correct about the .NET Framework?

A. NET Framework uses DCOM for achieving language interoperability.

B. NET Framework is built on the DCOM technology.

C. NET Framework uses DCOM for making transition between managed and unmanaged code.

D. NET Framework uses DCOM for creating unmanaged applications.

Answer» C. NET Framework uses DCOM for making transition between managed and unmanaged code.
discuss

12. Which of the following benefits do we get on running managed code under CLR?
1. Type safety of the code running under CLR is assured.
2. It is ensured that an application would not access the memory that it is not authorized to access.
3. It launches separate process for every application running under it.
4. The resources are Garbage collected.

A. Only 1 and 2

B. Only 2, 3 and 4

C. Only 1, 3 and 4

D. All of the above

Answer» D. All of the above


discuss

13. Which of the following jobs are done by Common Language Runtime?
1. It provides core services such as memory management, thread management, and remoting.
2. It enforces strict type safety.
3. It provides Code Access Security.
4. It provides Garbage Collection Services.

A. Only 1 and 2

B. Only 3 and 4

C. Only 1, 3 and 4

D. All of the above

Answer» D. All of the above


discuss
14. Which of the following statements are correct about a .NET Assembly?
1. It is the smallest deployable unit.
2. Each assembly has only one entry point - Main(), WinMain() or DLLMain().
3. An assembly can be a Shared assembly or a Private assembly.
4. An assembly can contain only code and data.
5. An assembly is always in the form of an EXE file.

A. 1,2,3

B. 2,4,5

C. 1,3,5

D. 1,2

Answer» D. 1,2
discuss

15. Which of the following statements are correct about JIT?


1. JIT compiler compiles instructions into machine code at run time.
2. The code compiler by the JIT compiler runs under CLR.
3. The instructions compiled by JIT compilers are written in native code.
4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code.
5. The method is JIT compiled even if it is not called

A. 1, 2, 3

B. 2,4

C. 3,4,5

D. 1,2

Answer» A. 1, 2, 3
discuss
16. Which of the following are parts of the .NET Framework?
1. The Common Language Runtime (CLR)
2. The Framework Class Libraries (FCL)
3. Microsoft Published Web Services
4. Applications deployed on IIS
5. Mobile Applications

A. Only 1, 2, 3

B. Only 1, 2

C. Only 1, 2, 4

D. Only 4,5

Answer» B. Only 1, 2
discuss

17. In C#, a subroutine is called a ________.

A. Function

B. Metadata

C. Method

D. Managed code

Answer» C. Method
discuss

18. All C# applications begin execution by calling the _____ method.

A. Class()

B. Main()

C. Submain()

D. Namespace

Answer» B. Main()
discuss

19. A _______ is an identifier that denotes a storage location

A. Constant

B. Reference type

C. Variable

D. Object

Answer» C. Variable
discuss
20. _________ are reserved, and cannot be used as identifiers.

A. Keywords

B. literal

C. variables

D. Identifiers

Answer» A. Keywords
discuss

21. Boxing converts a value type on the stack to an ______ on the heap.

A. Bool type

B. Instance type

C. Class type

D. Object type

Answer» D. Object type


discuss

22. The character pair?: is an________________available in C#.

A. Unary operator

B. Ternary operator

C. Decision operator

D. Functional operator

Answer» B. Ternary operator


discuss

23. In C#, all binary operators are ______.

A. Center-associative

B. Right-associative

Answer» C. Left-associative
23. In C#, all binary operators are ______.

C. Left-associative

D. Top-associative

Answer» C. Left-associative
discuss

24. An _______ is a symbol that tells the computer to perform certain mathematical or logical manipulations.

A. Operator

B. Expression

C. Condition

D. Logic

Answer» A. Operator
discuss

25. A _____ is any valid C# variable ending with a colon.

A. goto

B. Label

C. Logical

D. Bitwise

Answer» B. Label
discuss

26. C# has _______ operator, useful for making two way decisions.

A. Looping

B. Functional

C. Exponential

D. Conditional

Answer» D. Conditional
discuss

27. ________causes the loop to continue with the next iteration after skipping any statements in between.

A. Loop

B. Exit

C. Break

D. Continue

Answer» D. Continue
discuss

28. An ____ is a group of contiguous or related data items that share a common name.

A. Operator

B. Integer

C. Exponential

D. Array

Answer» D. Array
discuss

29. Arrays in C# are ______ objects

A. Reference

B. Logical

C. Value

D. Arithmetic

Answer» A. Reference
discuss

30. Multidimensional arrays are sometimes called _______ Arrays.

A. Square

Answer» C. Rectangular
30. Multidimensional arrays are sometimes called _______ Arrays.

B. Triangular

C. Rectangular

D. Cube

Answer» C. Rectangular
discuss

31. Which of the following define the rules for .Net Languages?

A. GAC

B. CLS

C. CTS

D. CLR

Answer» B. CLS
discuss

32. ___________ namespace is not defined in the .NET class library.

A. System.CodeDom

B. System

C. System.IO

D. System.Text

Answer» A. System.CodeDom
discuss

33. Dot Net Framework consists of :

A. Common language runtime

B. Set of class libraries

C. Common language runtime and set of class libraries

D. None of above

Answer» C. Common language runtime and set of class libraries


discuss

34. Which of the following statements are correct about JIT?


1. JIT compiler compiles instructions into machine code at run time.
2. The code compiler by the JIT compiler runs under CLR.
3. The instructions compiled by JIT compilers are written in native code.
4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code.

A. 1,2,3

Answer» A. 1,2,3
34. Which of the following statements are correct about JIT?
1. JIT compiler compiles instructions into machine code at run time.
2. The code compiler by the JIT compiler runs under CLR.
3. The instructions compiled by JIT compilers are written in native code.
4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code.

B. 2,4

C. 3,4

D. 1,2

Answer» A. 1,2,3
discuss

35. Which of the following is the root of the .NET type hierarchy?

A. System.Type

B. System.Base

C. System.Parent

D. System.Object

Answer» D. System.Object
discuss

36. Code that targets the Common Language Runtime is known as

A. Unmanaged

B. Distributed

C. Managed Code

D. Native Code

Answer» C. Managed Code


discuss
37. Which of the following statements correctly define .NET Framework?

It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and Web
A.
Services.

B. It is an environment for developing, building, deploying and executing only Web Applications.

C. It is an environment for developing, building, deploying and executing Distributed Applications.

D. It is an environment for developing, building, deploying and executing Web Services.

Answer» A. It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and
Web Services.
discuss

38. How many types of compilers availbale under CLR?

A. 4

B. 2

C. 1

D. 3

Answer» D. 3
discuss

39. Which of the following utilities can be used to compile managed assemblies into processor-specific native
code?

A. gacutil

B. ngen

C. sn

D. ildasm

Answer» B. ngen
discuss

Chapter: Unit 2

40. Which of the following statements are correct about data types?
1. If the integer literal exceeds the range of byte, a compilation error will occur.
2. We cannot implicitly convert non-literal numeric types of larger storage size to byte.
3. Byte cannot be implicitly converted to float.
4. A char can be implicitly converted to only int data type. 5. We can cast the integral character codes.

A. 1,3,5

B. 2,4

C. 3,5

D. 1,2,5

Answer» D. 1,2,5
discuss

41. Which of the following is NOT an Integer?

A. Char

B. Byte

C. Integer

D. Long

Answer» A. Char
discuss

42. What will be the output of the following code snippet when it is executed?
int x = 1;
float y = 1.1f;
short z = 1;
Console.Write.Line((float) x + y * z - (x += (short) y));

A. 0.1

B. 1.0

C. 1.1

D. 11

Answer» A. 0.1
discuss

43. Which of the following is the correct size of a Decimal datatype?

A. 8 bytes

B. 4 bytes

C. 10 bytes

D. None of the above

Answer» D. None of the above


discuss

44. Which of the following statements are correct?


1. We can assign values of any type to variables of type object.
2. When a variable of a value type is converted to object, it is said to be unboxed.
3. When a variable of type object is converted to a value type, it is said to be boxed.
4. Boolean variable cannot have a value of null.
5. When a value type is boxed, an entirely new object must be allocated and constructed.

A. 2,5

B. 1,5

Answer» B. 1,5
44. Which of the following statements are correct?
1. We can assign values of any type to variables of type object.
2. When a variable of a value type is converted to object, it is said to be unboxed.
3. When a variable of type object is converted to a value type, it is said to be boxed.
4. Boolean variable cannot have a value of null.
5. When a value type is boxed, an entirely new object must be allocated and constructed.

C. 3,4

D. 2,3

Answer» B. 1,5
discuss

45. Which of the following is the correct ways to set a value 3.14 in a variable pi such that it cannot be
modified?

A. float pi = 3.14F;

B. #define pi 3.14F;

C. const float pi = 3.14F;

D. const float pi; pi = 3.14F;

Answer» C. const float pi = 3.14F;


discuss

46. Which of the following can be used to terminate a while loop and transfer control outside the loop?
1. exit while
2. continue
3. exit statement
4. break
5. goto

A. 1,3

B. 2,4

C. 3,5

D. 4,5

Answer» D. 4,5
discuss
47. Which of the following statements are correct about the C#.NET
code snippet given below?
if (age > 18 && no < 11) a = 25;
1. The condition no < 11 will be evaluated only if age > 18 evaluates to True.
2. The statement a = 25 will get executed if any one condition is True.
3. The condition no < 11 will be evaluated only if age > 18 evaluates to False.
4. The statement a = 25 will get executed if both the conditions are True.
5. && is known as a short circuiting logical operator.

A. 1,3

B. 2,5

C. 1,4,5,

D. 3,4,5

Answer» C. 1,4,5,
discuss

48. Which of the following is the correct output for the C#.NET code snippet given below?
Console.WriteLine(13 / 2 + " " + 13 % 2);

A. 6.5 1

B. 6.5 0

C. 6 0

D. 6 1

Answer» D. 6 1
discuss

49. Which of the following statements are correct?


1. Instance members of a class can be accessed only through an object of that class.
2. A class can contain only instance data and instance member function.
3. All objects created from a class will occupy equal number of bytes in memory.
4. A class can contain Friend functions.
5. A class is a blueprint or a template according to which objects are created.

A. 1,3,5

B. 2,4

C. 3,5

D. 2,4,5

Answer» A. 1,3,5
discuss
50. Which of the following is the correct way to create an object of the class Sample?
1. Sample s = new Sample();
2. Sample s;
3. Sample s; s = new Sample();
4. s = new Sample();

A. 1,3

B. 2,4

C. 1,2,3

D. 4,5

Answer» A. 1,3
discuss
Chapter: Unit 2

51. Which of the following statements is correct about constructors?

A. If we provide a one-argument constructor then the compiler still provides a zeroargument constructor.

B. Overloaded constructors have the same name as the class name

C. Overloaded constructors cannot use optional arguments.

D. If we do not provide a constructor, then the compiler provides a zero-argument constructor.

Answer» D. If we do not provide a constructor, then the compiler provides a zero-argument constructor.
discuss

52. Which of the following statements is correct?

A. There is one garbage collector per program running in memory.

B. There is one common garbage collector for all programs.

C. An object is destroyed by the garbage collector when only one reference refers to it.

D. We have to specifically run the garbage collector after executing Visual Studio.NET.

Answer» B. There is one common garbage collector for all programs.


discuss

53. Which of the following can be facilitated by the Inheritance mechanism?


1. Use the existing functionality of base class.
2. Overrride the existing functionality of base class.
3. Implement new functionality in the derived class.
4. Implement polymorphic behaviour.
5. Implement containership.

A. 1,2,3

B. 3,4

C. 2,4,5

D. 3,5

Answer» A. 1,2,3
discuss

54. Which one of the following statements is correct?

A. Array elements can be of integer type only.

B. The rank of an Array is the total number of elements it can contain.

C. The length of an Array is the number of dimensions in the Array.

D. The default value of numeric array elements is zero.

Answer» D. The default value of numeric array elements is zero.


discuss
55. Which of the following statements are correct about arrays used in C#.NET?
1. Arrays can be rectangular or jagged.
2. Rectangular arrays have similar rows stored in adjacent memory locations.
3. Jagged arrays do not have an access to the methods of System.Array Class.
4. Rectangular arrays do not have an access to the methods of System.Array Class.
5. Jagged arrays have dissimilar rows stored in non-adjacent memory locations.

A. 1,2

B. 1,3,5

C. 3,4

D. 1,2,5

Answer» D. 1,2,5
discuss

56. Which of the following statements are correct?


1. A struct can contain properties.
2. A struct can contain constructors.
3. A struct can contain protected data members.
4. A struct cannot contain methods.
5. A struct cannot contain constants.

A. 1,2

B. 3,4

C. 1,2,4

D. 3,5

Answer» A. 1,2
discuss

57. Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "ALL MEN ARE CREATED EQUAL";
String s2; s2 = s1.Substring(12, 3);
Console.WriteLine(s2);

A. ARE

B. CRE

C. CR

D. REA

Answer» B. CRE
discuss
58. If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two
references?

A. s1 is s2

B. s1=s2

C. s1==s2

D. s1.Equals(s2)

Answer» D. s1.Equals(s2)
discuss

59. Which of the following statements is correct about an Exception?

A. It occurs during compilation.

B. It occurs during linking.

C. It occurs at run-time.

D. It occurs during Just-In-Time compilation.

Answer» C. It occurs at run-time.


discuss

60. Which of the following statements are correct about exception handling in C#.NET?
1 If an exception occurs then the program terminates abruptly without getting any chance to recover from
the exception. 2 No matter whether an exception occurs or not, the statements in the finally clause (if
present) will get executed.
3 A program can contain multiple finally clauses.
4 A finally clause is written outside the try block.
5 Finally clause is used to perform cleanup operations like closing the network/database connections.

A. 1 only

B. 2 only

C. 2 and 5 only

D. 3 and 4 only

Answer» C. 2 and 5 only


discuss

61. ______ parameters are used to pass results back to the calling method.

A. Input

B. Reference

C. Value

D. Output

Answer» D. Output
discuss
62. The formal-parameter-list is always enclosed in _______.

A. Square

B. Semicolon

C. Parenthesis

D. Colon

Answer» C. Parenthesis
discuss

63. _______ variables are visible only in the block they are declared.

A. System

B. Global

C. Local

D. Console

Answer» C. Local
discuss

64. C# does not support _____ constructors.

A. parameterized

B. parameter-less

C. Class

D. Method

Answer» B. parameter-less
discuss

65. A structure in C# provides a unique way of packing together data of ______ types.

A. Different

B. Same

C. Invoking

D. Calling

Answer» A. Different
discuss

66. Struct’s data members are ____________ by default.

A. Protected

B. Public

Answer» C. Private
66. Struct’s data members are ____________ by default.

C. Private

D. Default

Answer» C. Private
discuss

67. A _______ creates an object by copying variables from another object.

A. Copy constructor

B. Default constructor

C. Invoking constructor

D. Calling constructor

Answer» A. Copy constructor


discuss

68. The methods that have the same name, but different parameter lists and different definitions is called______.

A. Method Overloading

B. Method Overriding

C. Method Overwriting

D. Method Overreading

Answer» A. Method Overloading


discuss

69. The C# provides special methods known as _____ methods to provide access to data members.

A. Loop

B. Functions

C. Methods

D. Accessor

Answer» D. Accessor
discuss

70. Storage location used by computer memory to store data for usage by an application is ?

A. Pointers

B. Constants

C. Variable

D. None of the mentioned

Answer» C. Variable
discuss
71. Which of these can be overloaded?

A. Constructors

B. Methods

C. Both a & b

D. None of the mentioned

Answer» C. Both a & b


discuss

72. Number of constructors a class can define of ?

A. 1

B. 2

C. Any number

D. None of the mentioned

Answer» C. Any number


discuss

73. Correct statement about constructors in C#.NET is ?

A. Constructor cannot be overloaded

B. Constructor allocate space for object in memory

C. Constructor are never called explicitly

D. Constructor have same name as name of the class

Answer» D. Constructor have same name as name of the class


discuss

74. Constructors are used to

A. initialize the objects

B. construct the data members

C. both a & b

D. None of the mentioned

Answer» C. both a & b


discuss

75. To overload a method which of the following statement is false?

A. If the return type is different methods are overloaded

B. Name of the overloaded method should be same

Answer» A. If the return type is different methods are overloaded


75. To overload a method which of the following statement is false?

C. Type of the parameter should be different

D. Order of the parameter should be different if types are same

Answer» A. If the return type is different methods are overloaded


discuss

76. Which of the following statements is correct about constructors in C#.NET?

A. A constructor cannot be declared as private

B. A constructor cannot be overloaded

C. A constructor can be a static constructor

D. None of the mentioned

Answer» D. None of the mentioned


discuss

77. What is return type of constructors?

A. int

B. float

C. void

D. None of the mentioned

Answer» D. None of the mentioned


discuss

78. Which method have same name as that of its class?

A. delete

B. class

C. constructor

D. None of mentioned

Answer» C. constructor
discuss

79. Which of following statement 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 of private type

D. Omitting the return type in method definition results into exception

Answer» A. C# allows a function to have arguments with default values


discuss
Chapter: Unit 3

80. Which of the following statements are correct about an ArrayList collection that
implements the IEnumerable interface?
1. The ArrayList class contains an inner class that implements the IEnumerator interface.
2. An ArrayList Collection cannot be accessed simultaneously by different threads.
3. The inner class of ArrayList can access ArrayList class's members.
4. To access members of ArrayList from the inner class, it is necessary to pass ArrayList class's reference to
it.
5. Enumerator's of ArrayList Collection can manipulate the array.

A. 1 and 2 only

B. 1,3 and 4 only

C. 2 and 5 only

D. None of the above

Answer» B. 1,3 and 4 only


discuss

81. How many enumerators will exist if four threads are simultaneously working on an ArrayList object?

A. 1

B. 3

C. 2

D. 4

Answer» D. 4
discuss

82. In which of the following collections is the Input/Output index-based? 1. Stack 2. Queue 3. BitArray 4.
ArrayList 5. HashTable

A. 1 and 2 only

B. 3 and 4 only

C. 5 only

D. 1, 2 and 5 only

Answer» B. 3 and 4 only


discuss
83. Which of the following statements are correct about the Stack collection?
1. It can be used for evaluation of expressions.
2. All elements in the Stack collection can be accessed using an enumerator.
3. It is used to maintain a FIFO list.
4. All elements stored in a Stack collection must be of similar type.
5. Top-most element of the Stack collection can be accessed using the Peek() method.

A. 1 and 2 only

B. 3 and 4 only

C. 1, 2 and 5 only

D. All of the above

Answer» C. 1, 2 and 5 only


discuss

84. Which of the following is the correct way to access all elements of the Queue collection created using the
C#.NET code snippet given below? Queue q = new Queue(); q.Enqueue("Sachin"); q.Enqueue('A');
q.Enqueue(false); q.Enqueue(38); q.Enqueue(5.4);

A. IEnumerator e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

B. IEnumerable e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

C. IEnumerator e; e = q.GetEnumerable(); while (e.MoveNext()) Console.WriteLine(e.Current);

D. IEnumerator e; e = Queue.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

Answer» A. IEnumerator e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);


discuss

85. Which of the following statements is incorrect about delegate?

A. Delegates are reference types.

B. Delegates are object oriented.

C. Delegates are type-safe.

D. Only one method can be called using a delegate.

Answer» D. Only one method can be called using a delegate.


discuss
86. Which of the following statements are correct about the delegate declaration given below? delegate void
del(int I);
1. On declaring the delegate a class called del will get created.
2. The signature of del need not be same as the signature of the method that we intend to call using it.
3. The del class will be derived from the MulticastDelegate class.
4. The method that can be called using del should not be a static method.
5. The del class will contain a one-argument constructor and an lnvoke() method.

A. 1, 2 and 3 only

B. 1, 3 and 5 only

C. 2 and 4 only

D. 4 only

Answer» B. 1, 3 and 5 only


discuss

87. Suppose a Generic class called SortObjects is to be made capable of sorting objects of any type (Integer,
Single, Byte etc.). Which of the following programming constructs should be used to implement the
comparison function?

A. Namespace

B. Interface

C. Encapsulation

D. Delegate

Answer» D. Delegate
discuss

88. What is a delegate?

A. A strongly typed function pointer.

B. A light weight thread or process that can call a single method.

C. A reference to an object in a different process.

D. An inter-process message channel.

Answer» A. A strongly typed function pointer.


discuss

89. Which of the following is included in Visual Studio IDE?

A. Form Designer

B. Code Editor

C. Solution Explorer

Answer» D. All of the above


89. Which of the following is included in Visual Studio IDE?

D. All of the above

Answer» D. All of the above


discuss

90. Which of the following is true about dispose() method?

A. This method is protected.

B. Its return type is int.

C. It accepts a float parameter.

D. All of the above.

Answer» A. This method is protected.


discuss

91. Button class derives from

A. Checkbox

B. RadioButton

C. ButtonBase

D. None of the above

Answer» C. ButtonBase
discuss

92. Which namespace includes most of the Control classes for developing Windows applications?

A. System;

B. System.Windows.Controls

C. System.Windows.Components.Forms

D. System.Windows.Forms

Answer» C. System.Windows.Components.Forms
discuss

93. Which of the Control objects is viewed as a container that can hold other objects when you design a
Windows application?

A. Control

B. Button

C. Window

D. Form

Answer» D. Form
discuss
94. When an instance method declaration includes the abstract modifier, the method is said to be an ______.

A. Abstract method

B. Instance method

C. Sealed method

D. Expression method

Answer» A. Abstract method


discuss

95. The theory of _____ implies that user can control the access to a class, method, or variable.

A. Data hiding

B. Encapsulation

C. Information Hiding

D. Polymorphism

Answer» B. Encapsulation
discuss

96. Inheritance is ______ in nature.

A. Commutative

B. Associative

C. Transitive

D. Iterative

Answer» C. Transitive
discuss

97. The point at which an exception is thrown is called the _______.

A. Default point

B. Invoking point

C. Calling point

D. Throw point

Answer» D. Throw point


discuss

98. In C#, having unreachable code is always an _____.

A. Method

B. Function

C. Error

Answer» C. Error
98. In C#, having unreachable code is always an _____.

D. Iterative

Answer» C. Error
discuss

99. C# treats the multiple catch statements like cases in a _____________ statement.

A. If

B. Switch

C. For

D. While

Answer» B. Switch
discuss

100. C# supports a technique known as________, which allows a method to specify explicitly the name of the
interface it is implementing.

A. Method Implementation

B. Implicit Interface Implementation

C. Explicit Interface Implementation

D. Iterative Interface Implementation

Answer» C. Explicit Interface Implementation


discuss
Chapter: Unit 3

101. The reason that C# does not support multiple inheritances is because of ______.

A. Method collision

B. Name collision

C. Function collision

D. Interface collision

Answer» B. Name collision


discuss

102. _______ is a set of devices through which a user communicates with a system using interactive set of
commands.

A. Console

B. System

C. Keyboard

D. Monitor

Answer» A. Console
discuss

103. Exponential formatting character (‘E’ or ‘e’) converts a given value to string in the form of _______.

A. m.dddd

B. E+xxx

C. m.dddd

D. E+xxx

Answer» A. m.dddd
discuss

104. The ______ are the Graphical User Interface (GUI) components created for web based interactions..

A. Web forms

B. Window Forms

C. Application Forms

D. None of the above

Answer» B. Window Forms


discuss
105. In Microsoft Visual Studio, ______ technology and a programming language such as C# is used to create a
Web based application.

A. JAVA

B. J#

C. VB.NET

D. ASP.NET

Answer» D. ASP.NET
discuss

106. The controls available in the tool box of the ______ are used to create the user interface of a web based
application.

A. Microsoft visual studio IDE

B. Application window

C. Web forms

D. None of the above

Answer» A. Microsoft visual studio IDE


discuss

107. Web Forms consists of a _______ and a _________ .

A. Template, Component

B. CLR, CTS

C. HTML Forms, Web services

D. Windows, desktop

Answer» A. Template, Component


discuss

108. The ______ parentheses that follow _____ indicate that no information is passed to Main().

A. Empty, class

B. Empty, submain

C. Empty, Main

D. Empty, Namespace

Answer» C. Empty, Main


discuss

109. The scope of a variable depends on the ____________ and _________.

A. Main method, place of its declaration

Answer» B. Type of the variable, console


109. The scope of a variable depends on the ____________ and _________.

B. Type of the variable, console

C. compiler, main

D. Type of the variable, place of its declaration

Answer» B. Type of the variable, console


discuss

110. Which of the following statements is correct about the C#.NET code snippet given below?
class Student s1, s2; // Here 'Student' is a user-defined
class. s1 = new Student();
s2 = new Student();

A. Contents of s1 and s2 will be exactly same.

B. The two objects will get created on the stack.

C. Contents of the two objects created will be exactly same.

D. The two objects will always be created in adjacent memory locations.

Answer» C. Contents of the two objects created will be exactly same.


discuss

111. Which of the following can be facilitated by the Inheritance mechanism?


1 Use the existing functionality of base class.
2 Overrride the existing functionality of base class.
3 Implement new functionality in the derived class.
4 Implement polymorphic behaviour.
5 Implement containership.

A. 1, 2, 3

B. 3, 4

C. 2, 4, 5

D. 3, 5

Answer» A. 1, 2, 3
discuss

112. Which of the following should be used to implement a 'Has a' relationship between two entities?

A. Polymorphism

B. Templates

C. Containership

D. Encapsulation

Answer» C. Containership
discuss
113. Which of the following should be used to implement a 'Like a' or a 'Kind of' relationship between two
entities?

A. Polymorphism

B. Containership

C. Templates

D. Inheritance

Answer» D. Inheritance
discuss

114. How can you prevent inheritance from a class in C#.NET ?

A. Declare the class as shadows.

B. Declare the class as overloads.

C. Declare the class as seal

Answer» C. Declare the class as seal


discuss

115. A class implements two interfaces each containing three methods. The class contains no instance data.
Which of the following correctly indicate the size of the object created from this class?

A. 12 bytes

B. 24 bytes

C. 0 byte

D. 8 bytes

Answer» B. 24 bytes
discuss

116. Which of the following statements is correct about Interfaces used in C#.NET?

A. All interfaces are derived from an Object class.

B. Interfaces can be inherited.

C. All interfaces are derived from an Object interface.

D. Interfaces can contain only method declaration.

Answer» B. Interfaces can be inherited.


discuss

117. Which of the following statements is correct about an interface used in C#.NET?

A. If a class implements an interface partially, then it should be an abstract class.

B. Class cannot implement an interface partially.

Answer» A. If a class implements an interface partially, then it should be an abstract class.


117. Which of the following statements is correct about an interface used in C#.NET?

C. An interface can contain static methods.

D. An interface can contain static data.

Answer» A. If a class implements an interface partially, then it should be an abstract class.


discuss

118. Which of the following statements is correct about an interface?

A. One interface can be implemented in another interface.

B. An interface can be implemented by multiple classes in the same program.

C. A class that implements an interface can explicitly implement members of that interface.

D. The functions declared in an interface have a body.

Answer» C. A class that implements an interface can explicitly implement members of that interface.
discuss

Chapter: Unit 4

119. Databases store information in records, fields and:

A. data providers

B. grids

C. columns

D. tables

Answer» D. tables
discuss

120. Each data provider class is grouped and accessible through its:

A. namespace

B. database

C. datagrid

D. provider

Answer» A. namespace
discuss

121. In Visual Studio, the tool that enables you to connect to a database and automatically populate a dataset
object using a TableAdapter object is the ___________wizard:

A. Data Source Configuration

B. Data Source

C. Query Builder

Answer» A. Data Source Configuration


121. In Visual Studio, the tool that enables you to connect to a database and automatically populate a dataset
object using a TableAdapter object is the ___________wizard:

D. DataSet Designer

Answer» A. Data Source Configuration


discuss

122. In XML, a document is a hierarchy of

A. attributes

B. elements

C. tags

D. All of the above

Answer» B. elements
discuss

123. Which of the following namespace contains the LINQ to XML?

A. System.Xml;

B. System.Data;

C. System.Xml.Linq;

D. System.Linq;

Answer» C. System.Xml.Linq;
discuss

124. LINQ to SQL works with

A. SQL Server

B. SQL Server Compact 3.5

C. Both (a) and (b)

D. None of the above

Answer» C. Both (a) and (b)


discuss

125. A connection string contains

A. a using directive

B. the name of the data source

C. the version number of database management system

D. the list of fields in the database

Answer» B. the name of the data source


discuss
126. To avoid writing additional SQL statements to update a live database, you instantiate an object of which
class?

A. DataAdapter

B. DataReader

C. DataSet

D. CommandBuilder

Answer» A. DataAdapter
discuss

127. The following namespaces (System.Data.OleDB, System.Data.SqlClient, System.Data.Odbc,


System.Data.OracleClient) include classes for different:

A. Data providers

B. File streams

C. ADO.NET applications

D. Databases

Answer» A. Data providers


discuss

128. Which of the following is a definition of a database?

A. It is a collection of related information organized on a computer.

B. It is single flat file.

C. It is a file that can only be set up on a single PC.

D. It is a group of files that can be set up only on a network.

Answer» A. It is a collection of related information organized on a computer.


discuss

129. A computer application for managing databases and pulling together data to generate reports and make
decisions is known as a(n)

A. Database System (DS).

B. File Manager (FM).

C. Management System (MS).

D. Database Management System (DBMS).

Answer» D. Database Management System (DBMS).


discuss
130. Which of the following characterizes the relational model for databases?

A. It organizes data into a hierarchal format.

B. It splits data into separate row and column areas called tables.

C. It organizes data into one large table.

D. It organizes data into a network format.

Answer» B. It splits data into separate row and column areas called tables.
discuss

131. A field is a

A. group of records.

B. index that locates information in a table.

C. common characteristic in a table of information.

D. code that represents a record.

Answer» C. common characteristic in a table of information.


discuss

132. Forms and reports, used for entering and editing records, and for generating useful information in reports
are

A. additional database objects.

B. only useful for complex databases.

C. difficult to generate.

D. stored separately from databases.

Answer» D. stored separately from databases.


discuss

133. A computer application that manages a database, in which different kinds of data are stored in separate
tables, is known as a

A. Normal database system.

B. Network database system.

C. Standalone database system.

D. Relational database management system.

Answer» D. Relational database management system.


discuss

134. Which of the following are examples of relational database management systems?

A. Adobe Publisher and Autocad

Answer» D. Microsoft Access and SQL 2000


134. Which of the following are examples of relational database management systems?

B. Delphi and Turbo C++

C. Microsoft Excel and Microsoft Project

D. Microsoft Access and SQL 2000

Answer» D. Microsoft Access and SQL 2000


discuss

135. A unique field which distinguishs a record is known as a

A. Foreign key.

B. Primary key.

C. Tertiary key.

D. Secondary key.

Answer» D. Secondary key.


discuss

136. In a database, a parent-child relationship is also known as a

A. Many-to-one relationship.

B. Many-to-many relationship.

C. One-to-many relationship.

D. One-to-one relationship.

Answer» C. One-to-many relationship.


discuss

137. The field in the child table that links information to the parent table is known as the

A. Foreign key.

B. Primary key.

C. Tertiary key.

D. Secondary key.

Answer» A. Foreign key.


discuss

138. ADO.NET is the data access component of Microsoft’s .NET framework that enables you to

A. connect your Visual Basic.NET applications to your company’s local area network.

B. connect your Visual Basic.NET applications to databases.

C. connect your PC to the Internet.

Answer» B. connect your Visual Basic.NET applications to databases.


138. ADO.NET is the data access component of Microsoft’s .NET framework that enables you to

D. connect your local area network to the Internet.

Answer» B. connect your Visual Basic.NET applications to databases.


discuss

139. ADO.NET was created for

A. Multiple users.

B. Single users.

C. Home network users.

D. Limited users.

Answer» A. Multiple users.


discuss

140. Which of the following statements characterizes the relationship between a Visual Basic.NET program and
a database record?

A. They are connected.

B. External databases cannot be accessed by Visual Basic.NET.

C. They are connected as long as the program is running.

D. They are not connected.

Answer» C. They are connected as long as the program is running.


discuss

141. A copy of a database is called a

A. Duplicate database.

B. Dataset.

C. Table.

D. Database copy.

Answer» B. Dataset.
discuss

142. When is the dataset connected to the database?

A. Whenever the program makes changes to a field or record

B. They are always connected

C. They are always disconnected

D. Whenever the program is running

Answer» A. Whenever the program makes changes to a field or record


discuss
143. The connection to the database is established by

A. Using a local area network.

B. Installing a special software package.

C. Using managed providers.

D. Using a wide area network.

Answer» C. Using managed providers.


discuss

144. The ADO.NET disconnected dataset

A. Provides a flexible way of working with database records.

B. Makes working with databases very complex.

C. Requires a large amount of memory space.

D. Is required when single users want to access a database.

Answer» A. Provides a flexible way of working with database records.


discuss

145. XML provides a(n)

A. Difficult format for data storage.

B. Numeric based code for data storage.

C. Consistent format for data across applications, networks, and the Internet.

D. Limited format for data storage.

Answer» C. Consistent format for data across applications, networks, and the Internet.
discuss

146. Why does Visual Studio.NET use XML as a data storage technology?

A. XML works best for the single PC user.

B. XML restricts the number of applications that can interface with Visual Basic.NET.

C. XML is optimized for sharing data across the Internet.

D. XML is easier to understand than Visual Basic.NET.

Answer» C. XML is optimized for sharing data across the Internet.


discuss

147. Choose the correct statements about the LINQ?

A. The main concept behind the linq is query

B. linq make use of for loop to execute the query

C. It is not required that linq should make use of IEnumerable interface

Answer» A. The main concept behind the linq is query


147. Choose the correct statements about the LINQ?

D. None of the mentioned

Answer» A. The main concept behind the linq is query


discuss

148. Choose the namespace in which the interface IEnumerable is declared?

A. System.Collections

B. System.Collections.Generic

C. Both a & b

D. None of the mentioned

Answer» A. System.Collections
discuss

149. Can we use linq to query against a DataTable?

A. Yes

B. No

C. Situational

D. None of the mentioned

Answer» A. Yes
discuss

150. Select the namespace which should be included while making use of LINQ operations:

A. System.Text

B. System.Collections.Generic

C. System.Linq

D. None of the mentioned

Answer» C. System.Linq
discuss
https://www.youtube.com/@codewitharrays

https://www.instagram.com/codewitharrays/

https://t.me/codewitharrays Group Link: https://t.me/ccee2025notes

+91 8007592194 +91 9284926333

[email protected]

https://codewitharrays.in/project

You might also like